-
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
fix!: Fix gov amino codec #13196
fix!: Fix gov amino codec #13196
Conversation
}, | ||
{ | ||
"MsgSend", []sdk.Msg{banktypes.NewMsgSend(addrs[0], addrs[0], sdk.NewCoins())}, | ||
fmt.Sprintf(`{"type":"cosmos-sdk/v1/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"type":"cosmos-sdk/MsgSend","value":{"amount":[],"from_address":"%s","to_address":"%s"}}]}}`, addrs[0], addrs[0]), |
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.
This newly added test case fails on main. Main passes with the following string:
{"type":"cosmos-sdk/v1/MsgSubmitProposal","value":{"initial_deposit":[],"messages":[{"amount":[],"from_address":"%s","to_address":"%s"}]}}
which is incorrect
Codecov Report
@@ Coverage Diff @@
## main #13196 +/- ##
==========================================
+ Coverage 53.63% 53.66% +0.03%
==========================================
Files 647 647
Lines 55194 55199 +5
==========================================
+ Hits 29601 29624 +23
+ Misses 23219 23200 -19
- Partials 2374 2375 +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.
utACK
somewhat of a foot gun for users since its a hidden thing. Any ideas how to make it automatic?
drop amino support. More seriously though, I think Riccardo also had some thoughts about this, and this was the best solution we came up with. |
Yup, there are no other solutions to solve this unless we drop entirely the support for Amino |
@Mergifyio backport release/v0.46.x |
* fix!: Fix gov amino codec * changelog (cherry picked from commit d9972c4) # Conflicts: # CHANGELOG.md # x/distribution/types/codec.go # x/gov/simulation/operations_test.go # x/gov/types/v1/msgs.go # x/gov/types/v1/msgs_test.go # x/mint/types/codec.go # x/upgrade/types/codec.go
✅ Backports have been created
|
* fix!: Fix gov amino codec * changelog
* fix!: Fix gov amino codec * changelog
Description
Fix a bug when using amino-json with MsgSubmitProposal. Same as with authz, we need to register gov's ModuleCdc with every other module's
RegisterLegacyAmino
. We forgot to do that in v0.46 unfortunately.This results in a nested level of fields being cut-off:
Notice in the
messages
array, there's a nested level oftype
andlevel
missing. This makes the Ledger<>CosmJS integration impossible.The proposed solution is the same fix as for authz, i.e. in every module, register their msgs with the gov's ModuleCdc. To read more, you can read Simon's article about the topic.
cc'ing:
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