-
Notifications
You must be signed in to change notification settings - Fork 75
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(sequencer): query full denomination from asset ID #1067
Conversation
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.
Nothing critical, but a few suggestions.
I don't think a server should be returning a full stack trace as part of an error response message, hence I suggested changing the formatting of the anyhow errors from debug to alternate {:#}
to only include the display-formatted source chain. This might not be what we do elsewhere, so feel free to ignore.
Also, it might be nice to have some sad-path tests for the new endpoint, but that's not a blocker IMO.
@Fraser999 addressed comments - I changed the error returned to be display-formatted, but in the account query module, we return the debug formatted errors. do you think we should change it there as well? |
@noot - yes, I would vote for changing them all to return the alternate display form. There's still one debug one lingering in query.rs on line 95 btw :) |
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.
api approval
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 fine, but the DenomResponse
starting at number 1 is throwing me off?
|
||
// A response containing the denomination given an asset ID. | ||
message DenomResponse { | ||
uint64 height = 2; |
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.
should this start at 1?
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.
i did it to match the existing responses:
// A response containing the balance of an account.
message BalanceResponse {
uint64 height = 2;
repeated AssetBalance balances = 3;
}
// A response containing the current nonce for an account.
message NonceResponse {
uint64 height = 2;
uint32 nonce = 3;
}
should we change all of those?
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.
Yeah, they should all start at 1. Too late now because that would be a breaking change. 🤷
Summary
implement ABCI query to get full denomination from an asset ID, if it exists in the latest sequencer state.
Background
useful for block explorers/UIs as txs only have asset IDs, not the full denom.
Changes
Testing
unit tests
Related Issues
closes #1053