Skip to content

Commit c5a1f2a

Browse files
amaury1093ryanchristo
authored andcommitted
fix!: Fix gov amino codec (cosmos#13196)
* fix!: Fix gov amino codec * changelog
1 parent cb7b2b2 commit c5a1f2a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

docs/core/encoding.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,22 @@ Note, there are length-prefixed variants of the above functionality and this is
6767
typically used for when the data needs to be streamed or grouped together
6868
(e.g. `ResponseDeliverTx.Data`)
6969

70-
#### Authz authorizations
70+
#### Authz authorizations and Gov proposals
7171

72-
Since the `MsgExec` message type can contain different messages instances, it is important that developers
72+
Since authz's `MsgExec` and `MsgGrant` message types, as well as gov's `MsgSubmitProposal`, can contain different messages instances, it is important that developers
7373
add the following code inside the `init` method of their module's `codec.go` file:
7474

7575
```go
76-
import authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
76+
import (
77+
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
78+
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
79+
)
7780

7881
init() {
79-
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
80-
// used to properly serialize MsgGrant and MsgExec instances
82+
// Register all Amino interfaces and concrete types on the authz and gov Amino codec so that this can later be
83+
// used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances
8184
RegisterLegacyAminoCodec(authzcodec.Amino)
85+
RegisterLegacyAminoCodec(govcodec.Amino)
8286
}
8387
```
8488

0 commit comments

Comments
 (0)