-
Notifications
You must be signed in to change notification settings - Fork 46
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
feat: ADR-009: Supply module #782
Conversation
…supply-APIs-module � Conflicts: � app/app.go � x/profiles/types/query.pb.go � x/profiles/types/query.pb.gw.go
…esmos into leonardo/supply-APIs-module
- fixed tests - edited how circulating-supply is returned
…supply-APIs-module � Conflicts: � app/app.go � docs/architecture/adr-009-supply-module.md
refactored files
Codecov Report
@@ Coverage Diff @@
## master #782 +/- ##
==========================================
+ Coverage 81.39% 81.41% +0.01%
==========================================
Files 78 81 +3
Lines 6747 6839 +92
==========================================
+ Hits 5492 5568 +76
- Misses 1001 1013 +12
- Partials 254 258 +4
Continue to review full report at Codecov.
|
minor fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
|
||
// TotalSupply queries the total supply of the given denom, converted with the given divider | ||
rpc TotalSupply(QueryTotalSupplyRequest) | ||
returns (QueryTotalSupplyResponse) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of returning a QueryTotalSupplyResponse
, is there any way we can simply return a string here instead? So the REST response instead of looking like this
{
"total_supply": "<amount>"
}
Can simply look like this:
"<amount>"
Maybe something like StringValue from wrappers.proto
can work like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, but that makes the Protobuf linter angry...any way to skip to kind of checks on query returns types? @RiccardoM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result isn't what expected btw. Should we roll-back to the previous one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering CoinMarketCap requires the supply value to be returned simply as a value, we need a way to have this as well. From their docs we can read:
API endpoint that displays ONLY 'Total Supply' as a numerical value (e.g. http://chainz.cryptoid.info/grs/api.dws?q=totalcoins)
Probably the best way would be to register a custom REST endpoint. This can be done using the RegisterRESTRoutes
module method and registering a custom endpoint there.
Once that's done, we can simply revert to the previous answers for the gRPC endpoints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both done 👍
added missing amino codec added missing querier initialization to module
now returning an integer
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Signed-off-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Description
Closes: #773 .
This PR implements the
x/supply
module which serves some useful APIs to query bothTotalSupply
(converted from millionth) andCirculatingSupply
.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change