Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core-api): do not bind directly handler to class method to allow extending response #4045

Merged
merged 2 commits into from
Sep 18, 2020

Conversation

air1one
Copy link
Contributor

@air1one air1one commented Sep 18, 2020

Summary

Following up issue #3571 and PR #3928 which allowed to extend api response by getting the registered handler :

Refactor existing core-api routes handlers, using an arrow function to call the class method handler instead of directly binding the handler to the class method. This allow to easily extend the api response as shown in tests in PR #3928 .
(without using the arrow function, we would get issues with this when extending api response and calling the original handler)

Checklist

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

@codecov
Copy link

codecov bot commented Sep 18, 2020

Codecov Report

Merging #4045 into develop will increase coverage by 83.21%.
The diff coverage is 84.09%.

Impacted file tree graph

@@             Coverage Diff              @@
##           develop    #4045       +/-   ##
============================================
+ Coverage    13.27%   96.48%   +83.21%     
============================================
  Files          715      715               
  Lines        17172    17216       +44     
  Branches      2098     2098               
============================================
+ Hits          2279    16611    +14332     
+ Misses       14785      414    -14371     
- Partials       108      191       +83     
Flag Coverage Δ
#functional 5.98% <0.00%> (-0.02%) ⬇️
#integration 10.12% <84.09%> (+0.18%) ⬆️
#unit 94.47% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/core-api/src/routes/locks.ts 86.66% <50.00%> (-13.34%) ⬇️
packages/core-api/src/routes/wallets.ts 88.00% <66.66%> (-12.00%) ⬇️
packages/core-api/src/routes/delegates.ts 94.11% <80.00%> (-5.89%) ⬇️
packages/core-api/src/routes/transactions.ts 96.00% <88.88%> (-4.00%) ⬇️
packages/core-api/src/routes/blockchain.ts 100.00% <100.00%> (ø)
packages/core-api/src/routes/blocks.ts 100.00% <100.00%> (ø)
packages/core-api/src/routes/node.ts 100.00% <100.00%> (ø)
packages/core-api/src/routes/peers.ts 100.00% <100.00%> (ø)
packages/core-api/src/routes/rounds.ts 100.00% <100.00%> (ø)
packages/core-api/src/routes/votes.ts 100.00% <100.00%> (ø)
... and 642 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d3fe09...cacb4ce. Read the comment docs.

@faustbrian faustbrian merged commit bab1d91 into develop Sep 18, 2020
@ghost ghost deleted the refactor/api-routes-handlers branch September 18, 2020 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants