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

Fixed staking processors for the API routes #3024

Merged
merged 4 commits into from
Apr 19, 2021

Conversation

iulianpascalau
Copy link
Contributor

@iulianpascalau iulianpascalau commented Apr 19, 2021

  • fixed staking processors for the API routes

Testing scenario: do a top-up stake on an existing node. The routes: /network/economics should return the erd_total_base_staked_value value as a multiple of 2500 and erd_total_top_up_value the exact top-up-ed value. Next, the /network/direct-staked-info should return the correct value for that top-up-ed address (the BaseStaked should be a 2500 multiple, the TopUp should contain the top up value and the Total should be BaseStaked + TopUp)

miiu96
miiu96 previously approved these changes Apr 19, 2021
val := &api.DirectStakedValue{
Address: dslp.publicKeyConverter.Encode(leafKey),
Staked: totalStakedCurrentAccount.String(),
Staked: staked.String(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The separation into Staked and Total is misleading, as topup is also staked.

Can the field "staked" be renamed into base stake?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

sasurobert
sasurobert previously approved these changes Apr 19, 2021
@codecov
Copy link

codecov bot commented Apr 19, 2021

Codecov Report

Merging #3024 (f093219) into master (857c66f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head f093219 differs from pull request most recent head 0b3a110. Consider uploading reports for the commit 0b3a110 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3024   +/-   ##
=======================================
  Coverage   75.08%   75.08%           
=======================================
  Files         629      629           
  Lines       60826    60831    +5     
=======================================
+ Hits        45670    45675    +5     
  Misses      11039    11039           
  Partials     4117     4117           
Impacted Files Coverage Δ
api/network/routes.go 98.61% <100.00%> (ø)
node/trieIterators/commonStakingProcessor.go 100.00% <100.00%> (ø)
node/trieIterators/directStakedListProcessor.go 71.42% <100.00%> (+1.42%) ⬆️
node/trieIterators/stakeValuesProcessor.go 100.00% <100.00%> (ø)

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 54e154e...0b3a110. Read the comment docs.

Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System test passed.

@iulianpascalau iulianpascalau merged commit 2be09d2 into master Apr 19, 2021
@iulianpascalau iulianpascalau deleted the fix-staking-api-processors branch April 19, 2021 15:48
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

6 participants