Skip to content

Commit 05e27cb

Browse files
amaury1093mergify[bot]
authored andcommitted
fix!: Fix group amino codec (#13307)
* fix!: Fix group amino codec * changelog (cherry picked from commit 340c01b) # Conflicts: # CHANGELOG.md # docs/core/encoding.md # x/auth/types/codec.go # x/auth/vesting/types/codec.go # x/authz/codec.go # x/bank/types/codec.go # x/crisis/types/codec.go # x/distribution/types/codec.go # x/evidence/types/codec.go # x/feegrant/codec.go # x/gov/codec/doc.go # x/gov/types/v1/codec.go # x/gov/types/v1beta1/codec.go # x/group/codec.go # x/group/simulation/operations_test.go # x/mint/types/codec.go # x/slashing/types/codec.go # x/staking/types/codec.go # x/upgrade/types/codec.go
1 parent 72699f7 commit 05e27cb

File tree

23 files changed

+329
-36
lines changed

23 files changed

+329
-36
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,25 @@ Ref: https://keepachangelog.com/en/1.0.0/
7373

7474
### State Machine Breaking
7575

76+
<<<<<<< HEAD
7677
* (x/group) [#13876](https://github.com/cosmos/cosmos-sdk/pull/13876) Fix group MinExecutionPeriod that is checked on execution now, instead of voting period end.
78+
=======
79+
* (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.
80+
* (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.
81+
* (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.
82+
* (x/bank) [#12610](https://github.com/cosmos/cosmos-sdk/pull/12610) `MsgMultiSend` now allows only a single input.
83+
* (x/bank) [#12630](https://github.com/cosmos/cosmos-sdk/pull/12630) Migrate `x/bank` to self-managed parameters and deprecate its usage of `x/params`.
84+
* (x/auth) [#12475](https://github.com/cosmos/cosmos-sdk/pull/12475) Migrate `x/auth` to self-managed parameters and deprecate its usage of `x/params`.
85+
* (x/slashing) [#12399](https://github.com/cosmos/cosmos-sdk/pull/12399) Migrate `x/slashing` to self-managed parameters and deprecate its usage of `x/params`.
86+
* (x/mint) [#12363](https://github.com/cosmos/cosmos-sdk/pull/12363) Migrate `x/mint` to self-managed parameters and deprecate it's usage of `x/params`.
87+
* (x/distribution) [#12434](https://github.com/cosmos/cosmos-sdk/pull/12434) Migrate `x/distribution` to self-managed parameters and deprecate it's usage of `x/params`.
88+
* (x/crisis) [#12445](https://github.com/cosmos/cosmos-sdk/pull/12445) Migrate `x/crisis` to self-managed parameters and deprecate it's usage of `x/params`.
89+
* (x/gov) [#12631](https://github.com/cosmos/cosmos-sdk/pull/12631) Migrate `x/gov` to self-managed parameters and deprecate it's usage of `x/params`.
90+
* (x/staking) [#12409](https://github.com/cosmos/cosmos-sdk/pull/12409) Migrate `x/staking` to self-managed parameters and deprecate it's usage of `x/params`.
91+
* (x/bank) [#11859](https://github.com/cosmos/cosmos-sdk/pull/11859) Move the SendEnabled information out of the Params and into the state store directly.
92+
* (x/gov) [#12771](https://github.com/cosmos/cosmos-sdk/pull/12771) Initial deposit requirement for proposals at submission time.
93+
* (x/staking) [#12967](https://github.com/cosmos/cosmos-sdk/pull/12967) `unbond` now creates only one unbonding delegation entry when multiple unbondings exist at a single height (e.g. through multiple messages in a transaction).
94+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
7795
7896
### API Breaking Changes
7997

docs/core/encoding.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,37 @@ 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+
<<<<<<< HEAD
7071
#### Authz authorizations
7172

7273
Since the `MsgExec` message type can contain different messages instances, it is important that developers
7374
add the following code inside the `init` method of their module's `codec.go` file:
7475

7576
```go
7677
import authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
78+
=======
79+
#### Authz authorizations and Gov/Group proposals
80+
81+
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
82+
add the following code inside the `init` method of their module's `codec.go` file:
83+
84+
```go
85+
import (
86+
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
87+
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
88+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
89+
)
90+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
7791
7892
init() {
7993
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
8094
// used to properly serialize MsgGrant and MsgExec instances
8195
RegisterLegacyAminoCodec(authzcodec.Amino)
96+
<<<<<<< HEAD
97+
=======
98+
RegisterLegacyAminoCodec(govcodec.Amino)
99+
RegisterLegacyAminoCodec(groupcodec.Amino)
100+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
82101
}
83102
```
84103

x/auth/types/codec.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import (
77
sdk "github.com/cosmos/cosmos-sdk/types"
88
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
99
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
10+
<<<<<<< HEAD
11+
=======
12+
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
13+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
14+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
1015
)
1116

1217
// RegisterLegacyAminoCodec registers the account interfaces and concrete types on the
@@ -52,4 +57,9 @@ func init() {
5257
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
5358
// used to properly serialize MsgGrant and MsgExec instances
5459
RegisterLegacyAminoCodec(authzcodec.Amino)
60+
<<<<<<< HEAD
61+
=======
62+
RegisterLegacyAminoCodec(govcodec.Amino)
63+
RegisterLegacyAminoCodec(groupcodec.Amino)
64+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
5565
}

x/auth/vesting/types/codec.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ import (
1010
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
1111
"github.com/cosmos/cosmos-sdk/x/auth/vesting/exported"
1212
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
13+
<<<<<<< HEAD
14+
=======
15+
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
16+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
17+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
1318
)
1419

1520
// RegisterLegacyAminoCodec registers the vesting interfaces and concrete types on the
@@ -77,4 +82,9 @@ func init() {
7782
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
7883
// used to properly serialize MsgGrant and MsgExec instances
7984
RegisterLegacyAminoCodec(authzcodec.Amino)
85+
<<<<<<< HEAD
86+
=======
87+
RegisterLegacyAminoCodec(govcodec.Amino)
88+
RegisterLegacyAminoCodec(groupcodec.Amino)
89+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
8090
}

x/authz/codec.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import (
77
sdk "github.com/cosmos/cosmos-sdk/types"
88
"github.com/cosmos/cosmos-sdk/types/msgservice"
99
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
10+
<<<<<<< HEAD
11+
=======
12+
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
13+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
14+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
1015
)
1116

1217
// RegisterLegacyAminoCodec registers the necessary x/authz interfaces and concrete types
@@ -41,4 +46,9 @@ func init() {
4146
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
4247
// used to properly serialize MsgGrant and MsgExec instances
4348
RegisterLegacyAminoCodec(authzcodec.Amino)
49+
<<<<<<< HEAD
50+
=======
51+
RegisterLegacyAminoCodec(govcodec.Amino)
52+
RegisterLegacyAminoCodec(groupcodec.Amino)
53+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
4454
}

x/bank/types/codec.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ import (
99
"github.com/cosmos/cosmos-sdk/types/msgservice"
1010
"github.com/cosmos/cosmos-sdk/x/authz"
1111
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
12+
<<<<<<< HEAD
13+
=======
14+
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
15+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
16+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
1217
)
1318

1419
// RegisterLegacyAminoCodec registers the necessary x/bank interfaces and concrete types
@@ -45,4 +50,9 @@ func init() {
4550
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
4651
// used to properly serialize MsgGrant and MsgExec instances
4752
RegisterLegacyAminoCodec(authzcodec.Amino)
53+
<<<<<<< HEAD
54+
=======
55+
RegisterLegacyAminoCodec(govcodec.Amino)
56+
RegisterLegacyAminoCodec(groupcodec.Amino)
57+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
4858
}

x/crisis/types/codec.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import (
88
sdk "github.com/cosmos/cosmos-sdk/types"
99
"github.com/cosmos/cosmos-sdk/types/msgservice"
1010
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
11+
<<<<<<< HEAD
12+
=======
13+
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
14+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
15+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
1116
)
1217

1318
// RegisterLegacyAminoCodec registers the necessary x/crisis interfaces and concrete types
@@ -37,4 +42,9 @@ func init() {
3742
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
3843
// used to properly serialize MsgGrant and MsgExec instances
3944
RegisterLegacyAminoCodec(authzcodec.Amino)
45+
<<<<<<< HEAD
46+
=======
47+
RegisterLegacyAminoCodec(govcodec.Amino)
48+
RegisterLegacyAminoCodec(groupcodec.Amino)
49+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
4050
}

x/distribution/types/codec.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import (
88
sdk "github.com/cosmos/cosmos-sdk/types"
99
"github.com/cosmos/cosmos-sdk/types/msgservice"
1010
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
11+
<<<<<<< HEAD
1112
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
13+
=======
14+
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
15+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
16+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
1217
)
1318

1419
// RegisterLegacyAminoCodec registers the necessary x/distribution interfaces and concrete types
@@ -50,4 +55,9 @@ func init() {
5055
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
5156
// used to properly serialize MsgGrant and MsgExec instances
5257
RegisterLegacyAminoCodec(authzcodec.Amino)
58+
<<<<<<< HEAD
59+
=======
60+
RegisterLegacyAminoCodec(govcodec.Amino)
61+
RegisterLegacyAminoCodec(groupcodec.Amino)
62+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
5363
}

x/evidence/types/codec.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ import (
99
"github.com/cosmos/cosmos-sdk/types/msgservice"
1010
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
1111
"github.com/cosmos/cosmos-sdk/x/evidence/exported"
12+
<<<<<<< HEAD
13+
=======
14+
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
15+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
16+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
1217
)
1318

1419
// RegisterLegacyAminoCodec registers all the necessary types and interfaces for the
@@ -43,4 +48,9 @@ func init() {
4348
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
4449
// used to properly serialize MsgGrant and MsgExec instances
4550
RegisterLegacyAminoCodec(authzcodec.Amino)
51+
<<<<<<< HEAD
52+
=======
53+
RegisterLegacyAminoCodec(govcodec.Amino)
54+
RegisterLegacyAminoCodec(groupcodec.Amino)
55+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
4656
}

x/feegrant/codec.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import (
88
sdk "github.com/cosmos/cosmos-sdk/types"
99
"github.com/cosmos/cosmos-sdk/types/msgservice"
1010
authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
11+
<<<<<<< HEAD
12+
=======
13+
govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
14+
groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
15+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
1116
)
1217

1318
// RegisterLegacyAminoCodec registers the necessary x/feegrant interfaces and concrete types
@@ -60,4 +65,9 @@ func init() {
6065
// Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
6166
// used to properly serialize MsgGrant and MsgExec instances
6267
RegisterLegacyAminoCodec(authzcodec.Amino)
68+
<<<<<<< HEAD
69+
=======
70+
RegisterLegacyAminoCodec(govcodec.Amino)
71+
RegisterLegacyAminoCodec(groupcodec.Amino)
72+
>>>>>>> 340c01bf5 (fix!: Fix group amino codec (#13307))
6373
}

0 commit comments

Comments
 (0)