From 3aac9c1db7a309215b45945008aaee4c682ce11f Mon Sep 17 00:00:00 2001 From: Charly Date: Fri, 1 Sep 2023 13:41:44 +0200 Subject: [PATCH] call proposal sim function from appmodule --- modules/apps/27-interchain-accounts/module.go | 5 +++++ modules/core/module.go | 5 +++++ modules/core/{02-client => }/simulation/proposals.go | 0 modules/core/{02-client => }/simulation/proposals_test.go | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) rename modules/core/{02-client => }/simulation/proposals.go (100%) rename modules/core/{02-client => }/simulation/proposals_test.go (95%) diff --git a/modules/apps/27-interchain-accounts/module.go b/modules/apps/27-interchain-accounts/module.go index 1dceea8aa15..c1052b38b24 100644 --- a/modules/apps/27-interchain-accounts/module.go +++ b/modules/apps/27-interchain-accounts/module.go @@ -218,6 +218,11 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { + return simulation.ProposalMsgs() +} + // WeightedOperations is unimplemented. func (AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { return nil diff --git a/modules/core/module.go b/modules/core/module.go index 5369c955bc1..ada1054a472 100644 --- a/modules/core/module.go +++ b/modules/core/module.go @@ -190,6 +190,11 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simulation.RandomizedGenState(simState) } +// ProposalMsgs returns msgs used for governance proposals for simulations. +func (AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { + return simulation.ProposalMsgs() +} + // RegisterStoreDecoder registers a decoder for ibc module's types func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { sdr[exported.StoreKey] = simulation.NewDecodeStore(*am.keeper) diff --git a/modules/core/02-client/simulation/proposals.go b/modules/core/simulation/proposals.go similarity index 100% rename from modules/core/02-client/simulation/proposals.go rename to modules/core/simulation/proposals.go diff --git a/modules/core/02-client/simulation/proposals_test.go b/modules/core/simulation/proposals_test.go similarity index 95% rename from modules/core/02-client/simulation/proposals_test.go rename to modules/core/simulation/proposals_test.go index d8456e01a98..7cbbd71c7f6 100644 --- a/modules/core/02-client/simulation/proposals_test.go +++ b/modules/core/simulation/proposals_test.go @@ -12,8 +12,8 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/ibc-go/v7/modules/core/02-client/simulation" "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + "github.com/cosmos/ibc-go/v7/modules/core/simulation" ) func TestProposalMsgs(t *testing.T) {