mirror of https://github.com/certusone/wasmd.git
26 lines
590 B
Go
26 lines
590 B
Go
package simulation
|
|
|
|
import (
|
|
"github.com/CosmWasm/wasmd/x/wasm/internal/types"
|
|
"github.com/cosmos/cosmos-sdk/types/module"
|
|
)
|
|
|
|
// RandomizeGenState generates a random GenesisState for wasm
|
|
func RandomizedGenState(simstate *module.SimulationState) {
|
|
params := RandomParams(simstate.Rand)
|
|
wasmGenesis := types.GenesisState{
|
|
Params: params,
|
|
Codes: nil,
|
|
Contracts: nil,
|
|
Sequences: nil,
|
|
GenMsgs: nil,
|
|
}
|
|
|
|
_, err := simstate.Cdc.MarshalJSON(&wasmGenesis)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
simstate.GenState[types.ModuleName] = simstate.Cdc.MustMarshalJSON(&wasmGenesis)
|
|
}
|