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

Calculate supply in REST #285

Merged
merged 3 commits into from
Mar 21, 2024

Conversation

freak12techno
Copy link
Contributor

  1. add query for app to calculate supply
  2. use this query in nom supply endpoint
  3. add new endpoint to return supply on all denoms to return nom supply there (need to add BTC supply there as well, will probably add it in another PR)

src/app.rs Outdated
let community_pool_rewards_minted: u64 = self.community_pool_rewards.amount_minted.into();
let incentive_pool_rewards_minted: u64 = self.incentive_pool_rewards.amount_minted.into();

Ok(Amount::new(initial_supply + staking_rewards_minted + dev_rewards_minted + community_pool_rewards_minted + incentive_pool_rewards_minted))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need someone to review this part and verify this is how total supply is calculated on cosmos-sdk, not sure if cosmos-sdk considers all of these values or not

@mappum
Copy link
Contributor

mappum commented Mar 21, 2024

Sorry for the delay - looks like this just needs cargo fmt then can be merged.

@mappum mappum enabled auto-merge March 21, 2024 19:46
@freak12techno
Copy link
Contributor Author

@mappum you may try squash + merging this btw, to have 1 commit on main instead of 4 after merging

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.84%. Comparing base (8e7a02c) to head (7e819e4).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #285   +/-   ##
========================================
  Coverage    36.84%   36.84%           
========================================
  Files           25       25           
  Lines         9459     9459           
========================================
  Hits          3485     3485           
  Misses        5974     5974           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mappum mappum merged commit 2d44997 into nomic-io:develop Mar 21, 2024
8 checks passed
@freak12techno freak12techno deleted the calculate-supply-in-rest branch March 21, 2024 19:54
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.

3 participants