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

fix: supply calculation #1640

Merged
merged 6 commits into from Dec 5, 2018
Merged

fix: supply calculation #1640

merged 6 commits into from Dec 5, 2018

Conversation

spkjp
Copy link
Contributor

@spkjp spkjp commented Dec 5, 2018

Proposed changes

The supply calculation assumed the milestone would never change, which is not the case.

This PR adds a new helper to calculate the correct supply at the given height
by taking all the milestones up to the height into account.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improve a current implementation without adding a new feature or fixing a bug)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build (changes that affect the build system)
  • Docs (documentation only changes)
  • Test (adding missing tests or fixing existing tests)
  • Other... Please describe:

Checklist

  • I have read the CONTRIBUTING documentation
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@spkjp spkjp requested a review from faustbrian December 5, 2018 03:30
@ghost ghost assigned spkjp Dec 5, 2018
@ghost ghost added the review label Dec 5, 2018
@codecov-io
Copy link

codecov-io commented Dec 5, 2018

Codecov Report

Merging #1640 into develop will increase coverage by 0.18%.
The diff coverage is 92.85%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1640      +/-   ##
===========================================
+ Coverage    74.74%   74.92%   +0.18%     
===========================================
  Files          439      440       +1     
  Lines         7896     7917      +21     
  Branches      1039     1044       +5     
===========================================
+ Hits          5902     5932      +30     
+ Misses        1771     1764       -7     
+ Partials       223      221       -2
Impacted Files Coverage Δ
packages/core-vote-report/lib/handler.js 0% <0%> (ø) ⬆️
...ackages/core-api/lib/versions/1/handlers/blocks.js 88.57% <100%> (-0.91%) ⬇️
packages/core-utils/lib/supply-calculator.js 100% <100%> (ø)
...p2p/lib/server/versions/internal/handlers/utils.js 86.66% <0%> (+6.66%) ⬆️
packages/core-forger/lib/manager.js 78.64% <0%> (+6.79%) ⬆️

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 887f8b5...00fb807. Read the comment docs.

@ghost ghost assigned faustbrian Dec 5, 2018
@faustbrian faustbrian merged commit a6a6802 into ArkEcosystem:develop Dec 5, 2018
@ghost ghost removed the review label Dec 5, 2018
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

3 participants