-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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]: protocolpool create-continuous-pool panics #20935
Comments
This looks like an issue, but made me realize we shouldn't be exposing that command at all, given that it's meant to be used only through gov proposals |
We should expose the command, it will create a gov proposal thanks to https://github.com/cosmos/cosmos-sdk/blob/03d70aa/x/protocolpool/autocli.go#L73 |
Related: $ simdv2 q gov params
cannot marshal response params:{min_deposit:{denom:"stake" amount:"10000000"} max_deposit_period:{seconds:172800} voting_period:{seconds:600} quorum:"0.334000000000000000" threshold:"0.500000000000000000" veto_threshold:"0.334000000000000000" min_initial_deposit_ratio:"0.000000000000000000" proposal_cancel_ratio:"0.500000000000000000" expedited_voting_period:{seconds:300} expedited_threshold:"0.667000000000000000" expedited_min_deposit:{denom:"stake" amount:"50000000"} burn_vote_veto:true min_deposit_ratio:"0.010000000000000000" proposal_cancel_max_period:"0.500000000000000000" optimistic_rejected_threshold:"0.100000000000000000" yes_quorum:"0.000000000000000000" expedited_quorum:"0.500000000000000000" proposal_execution_gas:10000000}: math/big: cannot unmarshal "0.334000000000000000" into a *big.Int |
Is there an existing issue for this?
What happened?
When calling create-continuous-fund with a percentage expressed as a float, the command panics.
As I understand, auto-cli generates dynamicpb messages using protoreflect message Descriptor() and Interface(). In the case of MsgCreateContinuousFund, the percentage is set as a human-readable number.
Thus, it fails when decoding, as the unmarshalling of LegacyDec expects a machine representation of the floating-point number.
cosmos-sdk/x/protocolpool/types/tx.pb.go
Lines 2885 to 2887 in ab6400f
Cosmos SDK Version
main
How to reproduce?
./simd tx protocolpool create-continuous-fund cosmos18mfx85veapt3xs0vdr2cx9skeregs9sqawku8f 0.1 --summary test --title test --deposit 100000stake
The text was updated successfully, but these errors were encountered: