Restructure (probably) complete

This commit is contained in:
Christopher Goes 2018-07-18 01:01:36 +02:00
parent 253b82f92a
commit 5918ab18fd
2 changed files with 12 additions and 4 deletions

View File

@ -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

View File

@ -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),