diff --git a/x/ibcratelimit/ibcratelimitmodule/module.go b/x/ibcratelimit/ibcratelimitmodule/module.go index 1ddbd36d06..c342d4b4c1 100644 --- a/x/ibcratelimit/ibcratelimitmodule/module.go +++ b/x/ibcratelimit/ibcratelimitmodule/module.go @@ -23,6 +23,7 @@ import ( ibcratelimitclient "github.com/provenance-io/provenance/x/ibcratelimit/client" ibcratelimitcli "github.com/provenance-io/provenance/x/ibcratelimit/client/cli" "github.com/provenance-io/provenance/x/ibcratelimit/client/grpc" + "github.com/provenance-io/provenance/x/ibcratelimit/simulation" "github.com/provenance-io/provenance/x/ibcratelimit/types" ) @@ -98,9 +99,8 @@ func NewAppModule(ics4wrapper ibcratelimit.ICS4Wrapper) AppModule { } // GenerateGenesisState creates a randomized GenState of the ibcratelimit module. -func (am AppModule) GenerateGenesisState(_ *module.SimulationState) { - // Todo When we finish simulation - // simulation.RandomizedGenState(simState) +func (am AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState) } // ProposalContents returns content functions used to simulate governance proposals. diff --git a/x/ibcratelimit/simulation/genesis.go b/x/ibcratelimit/simulation/genesis.go new file mode 100644 index 0000000000..47026bacb8 --- /dev/null +++ b/x/ibcratelimit/simulation/genesis.go @@ -0,0 +1,24 @@ +package simulation + +// DONTCOVER + +import ( + "encoding/json" + "fmt" + + "github.com/cosmos/cosmos-sdk/types/module" + + "github.com/provenance-io/provenance/x/ibcratelimit/types" +) + +// RandomizedGenState generates a random GenesisState for ibchooks +func RandomizedGenState(simState *module.SimulationState) { + genesis := types.DefaultGenesis() + + bz, err := json.MarshalIndent(genesis, "", " ") + if err != nil { + panic(err) + } + fmt.Printf("Selected randomly generated ibchooks parameters:\n%s\n", bz) + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(genesis) +}