diff --git a/CHANGELOG.md b/CHANGELOG.md index c9e4ea7284e7..761aacdd1488 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -199,6 +199,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [](https://github.com/cosmos/cosmos-sdk/pull/16127) Use collections for deposit management: - The following methods are removed from the gov keeper: `GetDeposit`, `GetAllDeposits`, `IterateAllDeposits`. - The following functions are removed from the gov types: `DepositKey`, `DepositsKey`. +* (sims) [#16155](https://github.com/cosmos/cosmos-sdk/pull/16155) + * `simulation.NewOperationMsg` now marshals the operation msg as proto bytes instead of legacy amino JSON bytes. + * `simulation.NewOperationMsg` is now 2-arity instead of 3-arity with the obsolete argument `codec.ProtoCodec` removed. + * The field `OperationMsg.Msg` is now of type `[]byte` instead of `json.RawMessage`. ### Client Breaking Changes diff --git a/simapp/go.mod b/simapp/go.mod index 87278a12c36f..616459ecd7e3 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -39,7 +39,7 @@ require ( cloud.google.com/go/storage v1.30.0 // indirect cosmossdk.io/collections v0.1.0 // indirect cosmossdk.io/errors v1.0.0-beta.7.0.20230429155654-3ee8242364e4 // indirect - cosmossdk.io/x/tx v0.6.3 // indirect + cosmossdk.io/x/tx v0.7.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/tests/go.mod b/tests/go.mod index 83e00a1d235a..642b937c1ca7 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -14,7 +14,7 @@ require ( cosmossdk.io/x/evidence v0.1.0 cosmossdk.io/x/feegrant v0.0.0-20230117113717-50e7c4a4ceff cosmossdk.io/x/nft v0.0.0-20230113085233-fae3332d62fc - cosmossdk.io/x/tx v0.6.3 + cosmossdk.io/x/tx v0.7.0 cosmossdk.io/x/upgrade v0.0.0-20230127052425-54c8e1568335 github.com/cometbft/cometbft v0.37.1 github.com/cosmos/cosmos-db v1.0.0-rc.1 diff --git a/types/simulation/types.go b/types/simulation/types.go index 65f3b9ec289a..39d3e1677db2 100644 --- a/types/simulation/types.go +++ b/types/simulation/types.go @@ -6,9 +6,10 @@ import ( "math/rand" "time" + "github.com/cosmos/gogoproto/proto" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" ) @@ -70,11 +71,11 @@ type Operation func(r *rand.Rand, app *baseapp.BaseApp, // OperationMsg - structure for operation output type OperationMsg struct { - Route string `json:"route" yaml:"route"` // msg route (i.e module name) - Name string `json:"name" yaml:"name"` // operation name (msg Type or "no-operation") - Comment string `json:"comment" yaml:"comment"` // additional comment - OK bool `json:"ok" yaml:"ok"` // success - Msg json.RawMessage `json:"msg" yaml:"msg"` // JSON encoded msg + Route string `json:"route" yaml:"route"` // msg route (i.e module name) + Name string `json:"name" yaml:"name"` // operation name (msg Type or "no-operation") + Comment string `json:"comment" yaml:"comment"` // additional comment + OK bool `json:"ok" yaml:"ok"` // success + Msg []byte `json:"msg" yaml:"msg"` // protobuf encoded msg } // NewOperationMsgBasic creates a new operation message from raw input. @@ -89,21 +90,18 @@ func NewOperationMsgBasic(moduleName, msgType, comment string, ok bool, msg []by } // NewOperationMsg - create a new operation message from sdk.Msg -func NewOperationMsg(msg sdk.Msg, ok bool, comment string, cdc *codec.ProtoCodec) OperationMsg { +func NewOperationMsg(msg sdk.Msg, ok bool, comment string) OperationMsg { msgType := sdk.MsgTypeURL(msg) moduleName := sdk.GetModuleNameFromTypeURL(msgType) if moduleName == "" { moduleName = msgType } - if cdc == nil { - cdc = codec.NewProtoCodec(types.NewInterfaceRegistry()) - } - jsonBytes, err := cdc.MarshalAminoJSON(msg) + protoBz, err := proto.Marshal(msg) if err != nil { - panic(fmt.Errorf("failed to marshal aminon JSON: %w", err)) + panic(fmt.Errorf("failed to marshal proto message: %w", err)) } - return NewOperationMsgBasic(moduleName, msgType, comment, ok, jsonBytes) + return NewOperationMsgBasic(moduleName, msgType, comment, ok, protoBz) } // NoOpMsg - create a no-operation message diff --git a/x/authz/simulation/operations.go b/x/authz/simulation/operations.go index 5375970760eb..1c95ff7aa9c2 100644 --- a/x/authz/simulation/operations.go +++ b/x/authz/simulation/operations.go @@ -151,7 +151,7 @@ func SimulateMsgGrant( if err != nil { return simtypes.NoOpMsg(authz.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -229,7 +229,7 @@ func SimulateMsgRevoke( return simtypes.NoOpMsg(authz.ModuleName, TypeMsgRevoke, "unable to execute tx: "+err.Error()), nil, err } - return simtypes.NewOperationMsg(&msg, true, "", nil), nil, nil + return simtypes.NewOperationMsg(&msg, true, ""), nil, nil } } @@ -333,6 +333,6 @@ func SimulateMsgExec( if err != nil { return simtypes.NoOpMsg(authz.ModuleName, TypeMsgExec, "unmarshal error"), nil, err } - return simtypes.NewOperationMsg(&msgExec, true, "success", nil), nil, nil + return simtypes.NewOperationMsg(&msgExec, true, "success"), nil, nil } } diff --git a/x/authz/simulation/operations_test.go b/x/authz/simulation/operations_test.go index 729ec9642120..43b9212c0f5d 100644 --- a/x/authz/simulation/operations_test.go +++ b/x/authz/simulation/operations_test.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/client" @@ -138,7 +139,8 @@ func (suite *SimTestSuite) TestSimulateGrant() { suite.Require().NoError(err) var msg authz.MsgGrant - suite.legacyAmino.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(granter.Address.String(), msg.Granter) suite.Require().Equal(grantee.Address.String(), msg.Grantee) @@ -176,8 +178,8 @@ func (suite *SimTestSuite) TestSimulateRevoke() { suite.Require().NoError(err) var msg authz.MsgRevoke - suite.legacyAmino.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(granter.Address.String(), msg.Granter) suite.Require().Equal(grantee.Address.String(), msg.Grantee) @@ -211,9 +213,8 @@ func (suite *SimTestSuite) TestSimulateExec() { suite.Require().NoError(err) var msg authz.MsgExec - - suite.legacyAmino.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(grantee.Address.String(), msg.Grantee) suite.Require().Len(futureOperations, 0) diff --git a/x/bank/simulation/operations.go b/x/bank/simulation/operations.go index f2c00d9170dd..ef63090ee3cf 100644 --- a/x/bank/simulation/operations.go +++ b/x/bank/simulation/operations.go @@ -92,7 +92,7 @@ func SimulateMsgSend( return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "invalid transfers"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + return simtypes.NewOperationMsg(msg, true, ""), nil, nil } } @@ -131,7 +131,7 @@ func SimulateMsgSendToModuleAccount( return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "invalid transfers"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + return simtypes.NewOperationMsg(msg, true, ""), nil, nil } } @@ -272,7 +272,7 @@ func SimulateMsgMultiSend(txGen client.TxConfig, ak types.AccountKeeper, bk keep return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "invalid transfers"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + return simtypes.NewOperationMsg(msg, true, ""), nil, nil } } @@ -336,7 +336,7 @@ func SimulateMsgMultiSendToModuleAccount( if err != nil { return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "invalid transfers"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + return simtypes.NewOperationMsg(msg, true, ""), nil, nil } } diff --git a/x/bank/simulation/operations_test.go b/x/bank/simulation/operations_test.go index c1027427899e..98738e197724 100644 --- a/x/bank/simulation/operations_test.go +++ b/x/bank/simulation/operations_test.go @@ -8,6 +8,7 @@ import ( "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/client" @@ -114,8 +115,8 @@ func (suite *SimTestSuite) TestSimulateMsgSend() { suite.Require().NoError(err) var msg types.MsgSend - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal("65337742stake", msg.Amount.String()) suite.Require().Equal("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.FromAddress) @@ -142,8 +143,8 @@ func (suite *SimTestSuite) TestSimulateMsgMultiSend() { require.NoError(err) var msg types.MsgMultiSend - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) require.True(operationMsg.OK) require.Len(msg.Inputs, 1) require.Equal("cosmos1tnh2q55v8wyygtt9srz5safamzdengsnqeycj3", msg.Inputs[0].Address) @@ -178,8 +179,8 @@ func (suite *SimTestSuite) TestSimulateModuleAccountMsgSend() { suite.Require().Error(err) var msg types.MsgSend - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().False(operationMsg.OK) suite.Require().Equal(operationMsg.Comment, "invalid transfers") suite.Require().Equal(sdk.MsgTypeURL(&types.MsgSend{}), sdk.MsgTypeURL(&msg)) @@ -206,8 +207,8 @@ func (suite *SimTestSuite) TestSimulateMsgMultiSendToModuleAccount() { suite.Require().Error(err) var msg types.MsgMultiSend - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().False(operationMsg.OK) // sending tokens to a module account should fail suite.Require().Equal(operationMsg.Comment, "invalid transfers") suite.Require().Equal(sdk.MsgTypeURL(&types.MsgMultiSend{}), sdk.MsgTypeURL(&msg)) diff --git a/x/distribution/simulation/operations_test.go b/x/distribution/simulation/operations_test.go index 85dfc25a1d31..560e5eb19c53 100644 --- a/x/distribution/simulation/operations_test.go +++ b/x/distribution/simulation/operations_test.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/math" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/client" @@ -81,8 +82,8 @@ func (suite *SimTestSuite) TestSimulateMsgSetWithdrawAddress() { suite.Require().NoError(err) var msg types.MsgSetWithdrawAddress - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.DelegatorAddress) suite.Require().Equal("cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.WithdrawAddress) @@ -121,8 +122,8 @@ func (suite *SimTestSuite) TestSimulateMsgWithdrawDelegatorReward() { suite.Require().NoError(err) var msg types.MsgWithdrawDelegatorReward - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal("cosmosvaloper1l4s054098kk9hmr5753c6k3m2kw65h686d3mhr", msg.ValidatorAddress) suite.Require().Equal("cosmos1d6u7zhjwmsucs678d7qn95uqajd4ucl9jcjt26", msg.DelegatorAddress) @@ -181,8 +182,8 @@ func (suite *SimTestSuite) testSimulateMsgWithdrawValidatorCommission(tokenName suite.Require().NoError(err) var msg types.MsgWithdrawValidatorCommission - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal("cosmosvaloper1tnh2q55v8wyygtt9srz5safamzdengsn9dsd7z", msg.ValidatorAddress) suite.Require().Equal(sdk.MsgTypeURL(&types.MsgWithdrawValidatorCommission{}), sdk.MsgTypeURL(&msg)) @@ -207,8 +208,8 @@ func (suite *SimTestSuite) TestSimulateMsgFundCommunityPool() { suite.Require().NoError(err) var msg types.MsgFundCommunityPool - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal("4896096stake", msg.Amount.String()) suite.Require().Equal("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Depositor) diff --git a/x/gov/simulation/operations.go b/x/gov/simulation/operations.go index 33d7d454df13..8402ed6fe95a 100644 --- a/x/gov/simulation/operations.go +++ b/x/gov/simulation/operations.go @@ -273,7 +273,7 @@ func simulateMsgSubmitProposal( return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - opMsg := simtypes.NewOperationMsg(msg, true, "", nil) + opMsg := simtypes.NewOperationMsg(msg, true, "") // get the submitted proposal ID proposalID, err := k.GetProposalID(ctx) diff --git a/x/gov/simulation/operations_test.go b/x/gov/simulation/operations_test.go index ebed8e0b04d2..63c07a7fd2c8 100644 --- a/x/gov/simulation/operations_test.go +++ b/x/gov/simulation/operations_test.go @@ -10,6 +10,7 @@ import ( "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" "github.com/cosmos/cosmos-sdk/client" @@ -152,9 +153,8 @@ func TestSimulateMsgSubmitProposal(t *testing.T) { require.NoError(t, err) var msg v1.MsgSubmitProposal - err = govcodec.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) require.NoError(t, err) - require.True(t, operationMsg.OK) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Proposer) require.NotEqual(t, len(msg.InitialDeposit), 0) @@ -182,15 +182,23 @@ func TestSimulateMsgSubmitLegacyProposal(t *testing.T) { require.NoError(t, err) var msg v1.MsgSubmitProposal - err = govcodec.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) + require.NoError(t, err) + var msgLegacyContent v1.MsgExecLegacyContent + err = proto.Unmarshal(msg.Messages[0].Value, &msgLegacyContent) + require.NoError(t, err) + var textProposal v1beta1.TextProposal + err = proto.Unmarshal(msgLegacyContent.Content.Value, &textProposal) require.NoError(t, err) require.True(t, operationMsg.OK) require.Equal(t, "cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.Proposer) require.NotEqual(t, len(msg.InitialDeposit), 0) require.Equal(t, "25166256stake", msg.InitialDeposit[0].String()) - require.Equal(t, "title-3: ZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", msg.Messages[0].GetCachedValue().(*v1.MsgExecLegacyContent).Content.GetCachedValue().(v1beta1.Content).GetTitle()) - require.Equal(t, "description-3: NJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmbDkgRualsxDvRJuCAmPOXitIbcyWsKGSdrEunFAOdmXnsuyFVgJqEjbklvmwrUlsxjRSfKZxGcpayDdgoFcnVSutxjRgOSFzPwidAjubMncNweqpbxhXGchpZUxuFDOtpnhNUycJICRYqsPhPSCjPTWZFLkstHWJxvdPEAyEIxXgLwbNOjrgzmaujiBABBIXvcXpLrbcEWNNQsbjvgJFgJkflpRohHUutvnaUqoopuKjTDaemDeSdqbnOzcfJpcTuAQtZoiLZOoAIlboFDAeGmSNwkvObPRvRWQgWkGkxwtPauYgdkmypLjbqhlHJIQTntgWjXwZdOyYEdQRRLfMSdnxqppqUofqLbLQDUjwKVKfZJUJQPsWIPwIVaSTrmKskoAhvmZyJgeRpkaTfGgrJzAigcxtfshmiDCFkuiluqtMOkidknnTBtumyJYlIsWLnCQclqdVmikUoMOPdPWwYbJxXyqUVicNxFxyqJTenNblyyKSdlCbiXxUiYUiMwXZASYfvMDPFgxniSjWaZTjHkqlJvtBsXqwPpyVxnJVGFWhfSxgOcduoxkiopJvFjMmFabrGYeVtTXLhxVUEiGwYUvndjFGzDVntUvibiyZhfMQdMhgsiuysLMiePBNXifRLMsSmXPkwlPloUbJveCvUlaalhZHuvdkCnkSHbMbmOnrfEGPwQiACiPlnihiaOdbjPqPiTXaHDoJXjSlZmltGqNHHNrcKdlFSCdmVOuvDcBLdSklyGJmcLTbSFtALdGlPkqqecJrpLCXNPWefoTJNgEJlyMEPneVaxxduAAEqQpHWZodWyRkDAxzyMnFMcjSVqeRXLqsNyNtQBbuRvunZflWSbbvXXdkyLikYqutQhLPONXbvhcQZJPSWnOulqQaXmbfFxAkqfYese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jPNfjUCjhbdMAnJmYQVZBQZkFVweHDAlaqJjRqoQPoOMLhyvYCzqEuQsAFoxWrzRnTVjStPadhsESlERnKhpEPsfDxNvxqcOyIulaCkmPdambLHvGhTZzysvqFauEgkFRItPfvisehFmoBhQqmkfbHVsgfHXDPJVyhwPllQpuYLRYvGodxKjkarnSNgsXoKEMlaSKxKdcVgvOkuLcfLFfdtXGTclqfPOfeoVLbqcjcXCUEBgAGplrkgsmIEhWRZLlGPGCwKWRaCKMkBHTAcypUrYjWwCLtOPVygMwMANGoQwFnCqFrUGMCRZUGJKTZIGPyldsifauoMnJPLTcDHmilcmahlqOELaAUYDBuzsVywnDQfwRLGIWozYaOAilMBcObErwgTDNGWnwQMUgFFSKtPDMEoEQCTKVREqrXZSGLqwTMcxHfWotDllNkIJPMbXzjDVjPOOjCFuIvTyhXKLyhUScOXvYthRXpPfKwMhptXaxIxgqBoUqzrWbaoLTVpQoottZyPFfNOoMioXHRuFwMRYUiKvcWPkrayyTLOCFJlAyslDameIuqVAuxErqFPEWIScKpBORIuZqoXlZuTvAjEdlEWDODFRregDTqGNoFBIHxvimmIZwLfFyKUfEWAnNBdtdzDmTPXtpHRGdIbuucfTjOygZsTxPjfweXhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeH", msg.Messages[0].GetCachedValue().(*v1.MsgExecLegacyContent).Content.GetCachedValue().(v1beta1.Content).GetDescription()) + require.Equal(t, "title-3: ZBSpYuLyYggwexjxusrBqDOTtGTOWeLrQKjLxzIivHSlcxgdXhhuTSkuxKGLwQvuyNhYFmBZHeAerqyNEUzXPFGkqEGqiQWIXnku", + textProposal.GetTitle()) + require.Equal(t, "description-3: NJWzHdBNpAXKJPHWQdrGYcAHSctgVlqwqHoLfHsXUdStwfefwzqLuKEhmMyYLdbZrcPgYqjNHxPexsruwEGStAneKbWkQDDIlCWBLSiAASNhZqNFlPtfqPJoxKsgMdzjWqLWdqKQuJqWPMvwPQWZUtVMOTMYKJbfdlZsjdsomuScvDmb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vOkuLcfLFfdtXGTclqfPOfeoVLbqcjcXCUEBgAGplrkgsmIEhWRZLlGPGCwKWRaCKMkBHTAcypUrYjWwCLtOPVygMwMANGoQwFnCqFrUGMCRZUGJKTZIGPyldsifauoMnJPLTcDHmilcmahlqOELaAUYDBuzsVywnDQfwRLGIWozYaOAilMBcObErwgTDNGWnwQMUgFFSKtPDMEoEQCTKVREqrXZSGLqwTMcxHfWotDllNkIJPMbXzjDVjPOOjCFuIvTyhXKLyhUScOXvYthRXpPfKwMhptXaxIxgqBoUqzrWbaoLTVpQoottZyPFfNOoMioXHRuFwMRYUiKvcWPkrayyTLOCFJlAyslDameIuqVAuxErqFPEWIScKpBORIuZqoXlZuTvAjEdlEWDODFRregDTqGNoFBIHxvimmIZwLfFyKUfEWAnNBdtdzDmTPXtpHRGdIbuucfTjOygZsTxPjfweXhSUkMhPjMaxKlMIJMOXcnQfyzeOcbWwNbeH", + textProposal.GetDescription()) require.Equal(t, simulation.TypeMsgSubmitProposal, sdk.MsgTypeURL(&msg)) } @@ -230,9 +238,9 @@ func TestSimulateMsgCancelProposal(t *testing.T) { require.NoError(t, err) var msg v1.MsgCancelProposal - err = govcodec.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) + require.NoError(t, err) require.NoError(t, err) - require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, proposer.String(), msg.Proposer) @@ -275,9 +283,8 @@ func TestSimulateMsgDeposit(t *testing.T) { require.NoError(t, err) var msg v1.MsgDeposit - err = govcodec.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) require.NoError(t, err) - require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Depositor) @@ -322,8 +329,8 @@ func TestSimulateMsgVote(t *testing.T) { require.NoError(t, err) var msg v1.MsgVote - govcodec.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + require.NoError(t, err) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Voter) @@ -366,8 +373,8 @@ func TestSimulateMsgVoteWeighted(t *testing.T) { require.NoError(t, err) var msg v1.MsgVoteWeighted - govcodec.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + require.NoError(t, err) require.True(t, operationMsg.OK) require.Equal(t, uint64(1), msg.ProposalId) require.Equal(t, "cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Voter) diff --git a/x/group/simulation/operations.go b/x/group/simulation/operations.go index 7a17ebba89d0..39c2d1ac134c 100644 --- a/x/group/simulation/operations.go +++ b/x/group/simulation/operations.go @@ -287,7 +287,7 @@ func SimulateMsgCreateGroup( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -351,7 +351,7 @@ func SimulateMsgCreateGroupWithPolicy( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + return simtypes.NewOperationMsg(msg, true, ""), nil, nil } } @@ -417,7 +417,7 @@ func SimulateMsgCreateGroupPolicy( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -498,7 +498,7 @@ func SimulateMsgSubmitProposal( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -563,7 +563,7 @@ func SimulateMsgUpdateGroupAdmin( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -619,7 +619,7 @@ func SimulateMsgUpdateGroupMetadata( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -702,7 +702,7 @@ func SimulateMsgUpdateGroupMembers( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -767,7 +767,7 @@ func SimulateMsgUpdateGroupPolicyAdmin( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -831,7 +831,7 @@ func SimulateMsgUpdateGroupPolicyDecisionPolicy( if err != nil { return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -887,7 +887,7 @@ func SimulateMsgUpdateGroupPolicyMetadata( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -995,7 +995,7 @@ func SimulateMsgWithdrawProposal( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -1103,7 +1103,7 @@ func SimulateMsgVote( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -1183,7 +1183,7 @@ func SimulateMsgExec( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } @@ -1247,7 +1247,7 @@ func SimulateMsgLeaveGroup( return simtypes.NoOpMsg(group.ModuleName, sdk.MsgTypeURL(msg), err.Error()), nil, err } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, err + return simtypes.NewOperationMsg(msg, true, ""), nil, err } } diff --git a/x/group/simulation/operations_test.go b/x/group/simulation/operations_test.go index b26cf99a741a..e3df2abd1d3b 100644 --- a/x/group/simulation/operations_test.go +++ b/x/group/simulation/operations_test.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/log" abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/client" @@ -23,7 +24,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank/testutil" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/group" - groupcdc "github.com/cosmos/cosmos-sdk/x/group/codec" groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper" "github.com/cosmos/cosmos-sdk/x/group/simulation" grouptestutil "github.com/cosmos/cosmos-sdk/x/group/testutil" @@ -146,7 +146,7 @@ func (suite *SimTestSuite) TestSimulateCreateGroup() { suite.Require().NoError(err) var msg group.MsgCreateGroup - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(acc.Address.String(), msg.Admin) @@ -175,7 +175,7 @@ func (suite *SimTestSuite) TestSimulateCreateGroupWithPolicy() { suite.Require().NoError(err) var msg group.MsgCreateGroupWithPolicy - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(acc.Address.String(), msg.Admin) @@ -217,7 +217,7 @@ func (suite *SimTestSuite) TestSimulateCreateGroupPolicy() { suite.Require().NoError(err) var msg group.MsgCreateGroupPolicy - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(acc.Address.String(), msg.Admin) @@ -270,7 +270,7 @@ func (suite *SimTestSuite) TestSimulateSubmitProposal() { suite.Require().NoError(err) var msg group.MsgSubmitProposal - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(groupPolicyRes.Address, msg.GroupPolicyAddress) @@ -336,7 +336,7 @@ func (suite *SimTestSuite) TestWithdrawProposal() { suite.Require().NoError(err) var msg group.MsgWithdrawProposal - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(addr, msg.Address) @@ -403,7 +403,7 @@ func (suite *SimTestSuite) TestSimulateVote() { suite.Require().NoError(err) var msg group.MsgVote - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(addr, msg.Voter) @@ -478,7 +478,7 @@ func (suite *SimTestSuite) TestSimulateExec() { suite.Require().NoError(err) var msg group.MsgExec - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(addr, msg.Executor) @@ -520,7 +520,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupAdmin() { suite.Require().NoError(err) var msg group.MsgUpdateGroupAdmin - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(acc.Address.String(), msg.Admin) @@ -562,7 +562,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupMetadata() { suite.Require().NoError(err) var msg group.MsgUpdateGroupMetadata - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(acc.Address.String(), msg.Admin) @@ -604,7 +604,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupMembers() { suite.Require().NoError(err) var msg group.MsgUpdateGroupMembers - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(acc.Address.String(), msg.Admin) @@ -657,7 +657,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyAdmin() { suite.Require().NoError(err) var msg group.MsgUpdateGroupPolicyAdmin - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(groupPolicyRes.Address, msg.GroupPolicyAddress) @@ -710,7 +710,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyDecisionPolicy() { suite.Require().NoError(err) var msg group.MsgUpdateGroupPolicyDecisionPolicy - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(groupPolicyRes.Address, msg.GroupPolicyAddress) @@ -763,7 +763,7 @@ func (suite *SimTestSuite) TestSimulateUpdateGroupPolicyMetadata() { suite.Require().NoError(err) var msg group.MsgUpdateGroupPolicyMetadata - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(groupPolicyRes.Address, msg.GroupPolicyAddress) @@ -829,7 +829,7 @@ func (suite *SimTestSuite) TestSimulateLeaveGroup() { suite.Require().NoError(err) var msg group.MsgLeaveGroup - err = groupcdc.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) + err = proto.Unmarshal(operationMsg.Msg, &msg) suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal(groupRes.GroupId, msg.GroupId) diff --git a/x/nft/go.mod b/x/nft/go.mod index 8757e9659377..139f0bc3257f 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -6,13 +6,13 @@ require ( cosmossdk.io/api v0.4.1 cosmossdk.io/core v0.7.0 cosmossdk.io/depinject v1.0.0-alpha.3 - cosmossdk.io/errors v1.0.0-beta.7 + cosmossdk.io/errors v1.0.0-beta.7.0.20230429155654-3ee8242364e4 cosmossdk.io/log v1.1.0 cosmossdk.io/math v1.0.0 cosmossdk.io/store v0.1.0-alpha.1.0.20230328185921-37ba88872dbc github.com/cometbft/cometbft v0.37.1 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230426101247-6dfe7351a5c2 + github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230515163438-fa95ee2e666b github.com/cosmos/gogoproto v1.4.10 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 @@ -25,7 +25,7 @@ require ( require ( cosmossdk.io/collections v0.1.0 // indirect - cosmossdk.io/x/tx v0.5.5 // indirect + cosmossdk.io/x/tx v0.7.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -43,12 +43,12 @@ require ( github.com/cockroachdb/pebble v0.0.0-20230412222916-60cfeb46143b // indirect github.com/cockroachdb/redact v1.1.3 // indirect github.com/cometbft/cometbft-db v0.7.0 // indirect - github.com/confio/ics23/go v0.9.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0-rc.1 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v0.21.0-beta.1 // indirect + github.com/cosmos/iavl v0.21.0 // indirect + github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.0 // indirect github.com/creachadair/taskgroup v0.4.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -155,4 +155,11 @@ require ( // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 -replace github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 +replace ( + // TODO: remove me after collections 0.2. is released. + cosmossdk.io/collections => ../../collections + cosmossdk.io/store => ../../store + // TODO remove once https://github.com/cosmos/cosmos-sdk/pull/16155 is merged + github.com/cosmos/cosmos-sdk => ../.. + github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 +) diff --git a/x/nft/go.sum b/x/nft/go.sum index db8b980b81d6..7d204b900a0e 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -37,22 +37,18 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= cosmossdk.io/api v0.4.1 h1:0ikaYM6GyxTYYcfBiyR8YnLCfhNnhKpEFnaSepCTmqg= cosmossdk.io/api v0.4.1/go.mod h1:jR7k5ok90LxW2lFUXvd8Vpo/dr4PpiyVegxdm7b1ZdE= -cosmossdk.io/collections v0.1.0 h1:nzJGeiq32KnZroSrhB6rPifw4I85Cgmzw/YAmr4luv8= -cosmossdk.io/collections v0.1.0/go.mod h1:xbauc0YsbUF8qKMVeBZl0pFCunxBIhKN/WlxpZ3lBuo= cosmossdk.io/core v0.7.0 h1:GFss3qt2P9p23Cz24NnqLkslzb8n+B75A24x1JgJJp0= cosmossdk.io/core v0.7.0/go.mod h1:36hP0ZH/8ipsjzfcp0yKU4bqQXUGhS0/m1krWFCtwCc= cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= -cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= -cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= +cosmossdk.io/errors v1.0.0-beta.7.0.20230429155654-3ee8242364e4 h1:rOy7iw7HlwKc5Af5qIHLXdBx/F98o6du/I/WGwOW6eA= +cosmossdk.io/errors v1.0.0-beta.7.0.20230429155654-3ee8242364e4/go.mod h1:AwrAxbvuH9FdatzJX463kMYNMVkjujWU/xR+HsimWTw= cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= cosmossdk.io/math v1.0.0 h1:ro9w7eKx23om2tZz/VM2Pf+z2WAbGX1yDQQOJ6iGeJw= cosmossdk.io/math v1.0.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= -cosmossdk.io/store v0.1.0-alpha.1.0.20230328185921-37ba88872dbc h1:9piuA+NYmhe+SyMPtMoboLw/djgDbrI3dD5TG020Tnk= -cosmossdk.io/store v0.1.0-alpha.1.0.20230328185921-37ba88872dbc/go.mod h1:UFF5rmjN7WYVfxo6ArdY/l1+yyWMURBWOmSJypGqFHQ= -cosmossdk.io/x/tx v0.5.5 h1:9XG3KOrqObt7Rw7KhT7fiqRd6EepUfmA9ERa8CHj1WM= -cosmossdk.io/x/tx v0.5.5/go.mod h1:Oh3Kh+IPOfMEILNxVd2e8SLqRrIjYHpdGBfDg4ghU/k= +cosmossdk.io/x/tx v0.7.0 h1:b1UkXsg/A/PU4CvNjY37BRhJ9yuDPJRPhjeSQIP6Y0s= +cosmossdk.io/x/tx v0.7.0/go.mod h1:GVcwxDyQ4T38I5YDWs73W+jIGa9D16+iFIl+lYjAnDA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -173,8 +169,6 @@ github.com/cometbft/cometbft v0.37.1 h1:KLxkQTK2hICXYq21U2hn1W5hOVYUdQgDQ1uB+90x github.com/cometbft/cometbft v0.37.1/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -188,8 +182,6 @@ github.com/cosmos/cosmos-db v1.0.0-rc.1 h1:SjnT8B6WKMW9WEIX32qMhnEEKcI7ZP0+G1Sa9 github.com/cosmos/cosmos-db v1.0.0-rc.1/go.mod h1:Dnmk3flSf5lkwCqvvjNpoxjpXzhxnCAFzKHlbaForso= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230426101247-6dfe7351a5c2 h1:VjzSCR3T3w2+YW0fjNLbHIvB2EjpGGbsZ0jEZ3mIn2A= -github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230426101247-6dfe7351a5c2/go.mod h1:AD4IKrBq+M+oy1hlaBaDkyFcvoR82cLg0mS6lE2K0nU= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -198,8 +190,10 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI= github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= -github.com/cosmos/iavl v0.21.0-beta.1 h1:fBQeBc8HLZ14plJNcmGfaOXSSMLVEHvEQXiTXSD76m0= -github.com/cosmos/iavl v0.21.0-beta.1/go.mod h1:25YJYzilTErJ2mKfNB3xyWL9IsCwEQdNzdIutg2mh3U= +github.com/cosmos/iavl v0.21.0 h1:E39qwHl45PaQUe/mRA8lY4kOqaunOorVQufpv5JPgXk= +github.com/cosmos/iavl v0.21.0/go.mod h1:ejCWRfxvfmQTcligmeRcoQeB8VgHGxkVlIqKSKG7YaI= +github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= +github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.0 h1:ex0CvCxToSR7j5WjrghPu2Bu9sSXKikjnVvUryNnx4s= github.com/cosmos/ledger-cosmos-go v0.13.0/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= diff --git a/x/nft/simulation/operations.go b/x/nft/simulation/operations.go index b3bccf2b84f1..6c6fc72b510b 100644 --- a/x/nft/simulation/operations.go +++ b/x/nft/simulation/operations.go @@ -113,7 +113,7 @@ func SimulateMsgSend( return simtypes.NoOpMsg(nft.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(msg, true, "", cdc), nil, nil + return simtypes.NewOperationMsg(msg, true, ""), nil, nil } } diff --git a/x/simulation/util.go b/x/simulation/util.go index 13e90bb29ef3..263a7340b0b8 100644 --- a/x/simulation/util.go +++ b/x/simulation/util.go @@ -119,5 +119,5 @@ func GenAndDeliverTx(txCtx OperationInput, fees sdk.Coins) (simtypes.OperationMs return simtypes.NoOpMsg(txCtx.ModuleName, sdk.MsgTypeURL(txCtx.Msg), "unable to deliver tx"), nil, err } - return simtypes.NewOperationMsg(txCtx.Msg, true, "", txCtx.Cdc), nil, nil + return simtypes.NewOperationMsg(txCtx.Msg, true, ""), nil, nil } diff --git a/x/slashing/simulation/operations.go b/x/slashing/simulation/operations.go index cbdeb2b102eb..d703713e803a 100644 --- a/x/slashing/simulation/operations.go +++ b/x/slashing/simulation/operations.go @@ -130,23 +130,23 @@ func SimulateMsgUnjail( validator.TokensFromShares(selfDel.GetShares()).TruncateInt().LT(validator.GetMinSelfDelegation()) { if res != nil && err == nil { if info.Tombstoned { - return simtypes.NewOperationMsg(msg, true, "", nil), nil, errors.New("validator should not have been unjailed if validator tombstoned") + return simtypes.NewOperationMsg(msg, true, ""), nil, errors.New("validator should not have been unjailed if validator tombstoned") } if ctx.BlockHeader().Time.Before(info.JailedUntil) { - return simtypes.NewOperationMsg(msg, true, "", nil), nil, errors.New("validator unjailed while validator still in jail period") + return simtypes.NewOperationMsg(msg, true, ""), nil, errors.New("validator unjailed while validator still in jail period") } if validator.TokensFromShares(selfDel.GetShares()).TruncateInt().LT(validator.GetMinSelfDelegation()) { - return simtypes.NewOperationMsg(msg, true, "", nil), nil, errors.New("validator unjailed even though self-delegation too low") + return simtypes.NewOperationMsg(msg, true, ""), nil, errors.New("validator unjailed even though self-delegation too low") } } // msg failed as expected - return simtypes.NewOperationMsg(msg, false, "", nil), nil, nil + return simtypes.NewOperationMsg(msg, false, ""), nil, nil } if err != nil { return simtypes.NoOpMsg(types.ModuleName, sdk.MsgTypeURL(msg), "unable to deliver tx"), nil, errors.New(res.Log) } - return simtypes.NewOperationMsg(msg, true, "", nil), nil, nil + return simtypes.NewOperationMsg(msg, true, ""), nil, nil } } diff --git a/x/slashing/simulation/operations_test.go b/x/slashing/simulation/operations_test.go index 0677cb3ea06e..7aa1650e9a25 100644 --- a/x/slashing/simulation/operations_test.go +++ b/x/slashing/simulation/operations_test.go @@ -9,6 +9,7 @@ import ( abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" cmttypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/suite" "cosmossdk.io/depinject" @@ -188,8 +189,8 @@ func (suite *SimTestSuite) TestSimulateMsgUnjail() { suite.Require().NoError(err) var msg types.MsgUnjail - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + suite.Require().NoError(err) suite.Require().True(operationMsg.OK) suite.Require().Equal("cosmosvaloper1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7epjs3u", msg.ValidatorAddr) suite.Require().Len(futureOperations, 0) diff --git a/x/staking/simulation/operations_test.go b/x/staking/simulation/operations_test.go index d24793555981..3ff8442c05ba 100644 --- a/x/staking/simulation/operations_test.go +++ b/x/staking/simulation/operations_test.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/depinject" sdklog "cosmossdk.io/log" "cosmossdk.io/math" + "github.com/cosmos/gogoproto/proto" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -175,8 +176,8 @@ func (s *SimTestSuite) TestSimulateMsgCreateValidator() { require.NoError(err) var msg types.MsgCreateValidator - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + require.NoError(err) require.True(operationMsg.OK) require.Equal(sdk.MsgTypeURL(&types.MsgCreateValidator{}), sdk.MsgTypeURL(&msg)) valaddr, err := sdk.ValAddressFromBech32(msg.ValidatorAddress) @@ -221,8 +222,8 @@ func (s *SimTestSuite) TestSimulateMsgCancelUnbondingDelegation() { require.NoError(err) var msg types.MsgCancelUnbondingDelegation - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + require.NoError(err) require.True(operationMsg.OK) require.Equal(sdk.MsgTypeURL(&types.MsgCancelUnbondingDelegation{}), sdk.MsgTypeURL(&msg)) require.Equal(delegator.Address.String(), msg.DelegatorAddress) @@ -249,8 +250,8 @@ func (s *SimTestSuite) TestSimulateMsgEditValidator() { require.NoError(err) var msg types.MsgEditValidator - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + require.NoError(err) require.True(operationMsg.OK) require.Equal(sdk.MsgTypeURL(&types.MsgEditValidator{}), sdk.MsgTypeURL(&msg)) require.Equal("cosmosvaloper1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7epjs3u", msg.ValidatorAddress) @@ -270,8 +271,8 @@ func (s *SimTestSuite) TestSimulateMsgDelegate() { require.NoError(err) var msg types.MsgDelegate - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + require.NoError(err) require.True(operationMsg.OK) require.Equal("cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.DelegatorAddress) require.Equal("stake", msg.Amount.Denom) @@ -309,8 +310,8 @@ func (s *SimTestSuite) TestSimulateMsgUndelegate() { require.NoError(err) var msg types.MsgUndelegate - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + require.NoError(err) require.True(operationMsg.OK) require.Equal("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.DelegatorAddress) require.Equal("1646627814093010272", msg.Amount.Amount.String()) @@ -353,8 +354,8 @@ func (s *SimTestSuite) TestSimulateMsgBeginRedelegate() { require.NoError(err) var msg types.MsgBeginRedelegate - types.ModuleCdc.UnmarshalJSON(operationMsg.Msg, &msg) - + err = proto.Unmarshal(operationMsg.Msg, &msg) + require.NoError(err) require.True(operationMsg.OK) require.Equal("cosmos1ua0fwyws7vzjrry3pqkklvf8mny93l9s9zg0h4", msg.DelegatorAddress) require.Equal("stake", msg.Amount.Denom)