diff --git a/cmd/gaia/app/sim_test.go b/cmd/gaia/app/sim_test.go index 2fd2a55b6b..86c0de5942 100644 --- a/cmd/gaia/app/sim_test.go +++ b/cmd/gaia/app/sim_test.go @@ -19,8 +19,8 @@ import ( const ( NumKeys = 10 - NumBlocks = 1000 - BlockSize = 1000 + NumBlocks = 100 + BlockSize = 500 simulationEnv = "ENABLE_GAIA_SIMULATION" ) @@ -38,9 +38,11 @@ func appStateFn(r *rand.Rand, accs []sdk.AccAddress) json.RawMessage { } // Default genesis state + stakeGenesis := stake.DefaultGenesisState() + stakeGenesis.Pool.LooseTokens = sdk.NewRat(1000) genesis := GenesisState{ Accounts: genesisAccounts, - StakeData: stake.DefaultGenesisState(), + StakeData: stakeGenesis, } // Marshal genesis diff --git a/x/stake/simulation/sim_test.go b/x/stake/simulation/sim_test.go index c26f6c82c0..a009dafe11 100644 --- a/x/stake/simulation/sim_test.go +++ b/x/stake/simulation/sim_test.go @@ -2,6 +2,7 @@ package simulation import ( "encoding/json" + "math/rand" "testing" sdk "github.com/cosmos/cosmos-sdk/types" @@ -34,8 +35,13 @@ func TestStakeWithRandomMessages(t *testing.T) { panic(err) } + appStateFn := func(r *rand.Rand, accs []sdk.AccAddress) json.RawMessage { + mock.RandomSetGenesis(r, mapp, accs, []string{"stake"}) + return json.RawMessage("{}") + } + simulation.Simulate( - t, mapp.BaseApp, json.RawMessage("{}"), + t, mapp.BaseApp, appStateFn, []simulation.TestAndRunTx{ SimulateMsgCreateValidator(mapper, stakeKeeper), SimulateMsgEditValidator(stakeKeeper),