Skip to content

Commit 340c01b

Browse files
authored
fix!: Fix group amino codec (#13307)
* fix!: Fix group amino codec * changelog
1 parent 3fd6ac9 commit 340c01b

File tree

23 files changed

+132
-42
lines changed

23 files changed

+132
-42
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
8888

8989
### State Machine Breaking
9090

91+
* (codec) [#13307](https://github.com/cosmos/cosmos-sdk/pull/13307) Register all modules' `Msg`s with group's ModuleCdc so that Amino sign bytes are correctly generated.
9192
* (codec) [#13196](https://github.com/cosmos/cosmos-sdk/pull/13196) Register all modules' `Msg`s with gov's ModuleCdc so that Amino sign bytes are correctly generated.
9293
* (x/distribution) [#12852](https://github.com/cosmos/cosmos-sdk/pull/12852) Deprecate `CommunityPoolSpendProposal`. Please execute a `MsgCommunityPoolSpend` message via the new v1 `x/gov` module instead. This message can be used to directly fund the `x/gov` module account.
9394
* (x/bank) [#12610](https://github.com/cosmos/cosmos-sdk/pull/12610) `MsgMultiSend` now allows only a single input.

docs/core/encoding.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,24 @@ 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 and Gov proposals
70+
#### Authz authorizations and Gov/Group proposals
7171

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
72+
Since authz's `MsgExec` and `MsgGrant` message types, as well as gov's and group'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
7676
import (
7777
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
7878
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
79+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
7980
)
8081

8182
init() {
8283
// Register all Amino interfaces and concrete types on the authz and gov Amino codec so that this can later be
8384
// used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances
8485
RegisterLegacyAminoCodec(authzcodec.Amino)
8586
RegisterLegacyAminoCodec(govcodec.Amino)
87+
RegisterLegacyAminoCodec(groupcodec.Amino)
8688
}
8789
```
8890

x/auth/types/codec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
1010
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
1111
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
12+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
1213
)
1314

1415
// RegisterLegacyAminoCodec registers the account interfaces and concrete types on the
@@ -62,4 +63,5 @@ func init() {
6263
// used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances
6364
RegisterLegacyAminoCodec(authzcodec.Amino)
6465
RegisterLegacyAminoCodec(govcodec.Amino)
66+
RegisterLegacyAminoCodec(groupcodec.Amino)
6567
}

x/auth/vesting/types/codec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/cosmos/cosmos-sdk/x/auth/vesting/exported"
1212
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
1313
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
14+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
1415
)
1516

1617
// RegisterLegacyAminoCodec registers the vesting interfaces and concrete types on the
@@ -79,4 +80,5 @@ func init() {
7980
// used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances
8081
RegisterLegacyAminoCodec(authzcodec.Amino)
8182
RegisterLegacyAminoCodec(govcodec.Amino)
83+
RegisterLegacyAminoCodec(groupcodec.Amino)
8284
}

x/authz/codec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/cosmos/cosmos-sdk/types/msgservice"
99
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
1010
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
11+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
1112
)
1213

1314
// RegisterLegacyAminoCodec registers the necessary x/authz interfaces and concrete types
@@ -43,4 +44,5 @@ func init() {
4344
// used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances
4445
RegisterLegacyAminoCodec(authzcodec.Amino)
4546
RegisterLegacyAminoCodec(govcodec.Amino)
47+
RegisterLegacyAminoCodec(groupcodec.Amino)
4648
}

x/bank/types/codec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/cosmos/cosmos-sdk/x/authz"
1111
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
1212
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
13+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
1314
)
1415

1516
// RegisterLegacyAminoCodec registers the necessary x/bank interfaces and concrete types
@@ -51,4 +52,5 @@ func init() {
5152
// used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances
5253
RegisterLegacyAminoCodec(authzcodec.Amino)
5354
RegisterLegacyAminoCodec(govcodec.Amino)
55+
RegisterLegacyAminoCodec(groupcodec.Amino)
5456
}

x/crisis/types/codec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/cosmos/cosmos-sdk/types/msgservice"
1010
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
1111
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
12+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
1213
)
1314

1415
// RegisterLegacyAminoCodec registers the necessary x/crisis interfaces and concrete types
@@ -41,4 +42,5 @@ func init() {
4142
// used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances
4243
RegisterLegacyAminoCodec(authzcodec.Amino)
4344
RegisterLegacyAminoCodec(govcodec.Amino)
45+
RegisterLegacyAminoCodec(groupcodec.Amino)
4446
}

x/distribution/types/codec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/cosmos/cosmos-sdk/types/msgservice"
1010
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
1111
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
12+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
1213
)
1314

1415
// RegisterLegacyAminoCodec registers the necessary x/distribution interfaces
@@ -54,4 +55,5 @@ func init() {
5455
// instances.
5556
RegisterLegacyAminoCodec(authzcodec.Amino)
5657
RegisterLegacyAminoCodec(govcodec.Amino)
58+
RegisterLegacyAminoCodec(groupcodec.Amino)
5759
}

x/evidence/types/codec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
1111
"github.com/cosmos/cosmos-sdk/x/evidence/exported"
1212
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
13+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
1314
)
1415

1516
// RegisterLegacyAminoCodec registers all the necessary types and interfaces for the
@@ -45,4 +46,5 @@ func init() {
4546
// used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances
4647
RegisterLegacyAminoCodec(authzcodec.Amino)
4748
RegisterLegacyAminoCodec(govcodec.Amino)
49+
RegisterLegacyAminoCodec(groupcodec.Amino)
4850
}

x/feegrant/codec.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/cosmos/cosmos-sdk/types/msgservice"
1010
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
1111
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
12+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
1213
)
1314

1415
// RegisterLegacyAminoCodec registers the necessary x/feegrant interfaces and concrete types
@@ -62,4 +63,5 @@ func init() {
6263
// used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances
6364
RegisterLegacyAminoCodec(authzcodec.Amino)
6465
RegisterLegacyAminoCodec(govcodec.Amino)
66+
RegisterLegacyAminoCodec(groupcodec.Amino)
6567
}

0 commit comments

Comments
 (0)