-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Bug]: Type cosmossdk_io_math.LegacyDec (from package cosmossdk.io/math) not show correctly if the cli generated using autocli #19975
Comments
Hi! What's your x/tx version? |
Thank you for finding this, I can reproduce. https://v050.simapp.zone:1317/cosmos/distribution/v1beta1/community_pool {
"pool": [
{
"denom": "stake",
"amount": "435835.220000000000000000"
}
]
} While We need to define another encoder like this: https://github.com/cosmos/cosmos-sdk/blob/main/client/v2/autocli/query.go#L161-L186, as apparently, |
Hi @julienrbrt , |
We'll release a client/v2 |
Hi @julienrbrt, Thanks |
Correct, we've been backporting things, and the one PR that we want merged before beta.2 is still wip: #19530 Feel free to follow the issue above to be alerted. |
Hi @julienrbrt,
|
Hi @julienrbrt, Thanks |
Hi, this release: #19530 |
@julienrbrt is this able to be closed? |
No, it's done for one of the two (DecCoin but not yet LegacyDec) |
Hi @julienrbrt, do you have any plan to fix the issue? Still waiting for the release. |
Yep, client/v2 now has my full attention. Expect a release this week! |
Is there an existing issue for this?
What happened?
I am facing an issue with the client cli command generated using autocli. Any Msg response from server that has field with type DecCoin (underlying type is cosmossdk_io_math.LegacyDec) will be shown incorrectly. Here are some examples:
I have a custom module that will return a DecCoin type when query balances of account:
message QueryBalancesResponse { repeated cosmos.base.v1beta1.DecCoin coins = 1; }
NOTE: the correct balances is: 4000000000ntoken OR 4token
When using autocli to generate the client query cmd it show incorrect balances:
when using the cosmos's bank module to show, it shows correctly (because cosmos's bank using: cosmos.base.v1beta1.Coin):
If I use custom command (which uses client.PrintProto() from package "github.com/cosmos/cosmos-sdk/client") it also print output correctly.
The gov module also show wrong number if the Params have type DecCoin.
cosmos.base.v1beta1.DecCoin minimum_gas_prices
proposal.json:
gov query output:
My previous solution is using
EnhanceCustomCommand: true
and keep our custom client cli to use theclient.PrintProto()
for our custom modules. But problem still happen with cosmos's core module like staking, gov. Here is the list of comos's module still use DecCoin type.Cosmos SDK Version
0.50.3
How to reproduce?
No response
The text was updated successfully, but these errors were encountered: