Restructure (probably) complete
This commit is contained in:
parent
253b82f92a
commit
5918ab18fd
|
@ -19,8 +19,8 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
NumKeys = 10
|
NumKeys = 10
|
||||||
NumBlocks = 1000
|
NumBlocks = 100
|
||||||
BlockSize = 1000
|
BlockSize = 500
|
||||||
|
|
||||||
simulationEnv = "ENABLE_GAIA_SIMULATION"
|
simulationEnv = "ENABLE_GAIA_SIMULATION"
|
||||||
)
|
)
|
||||||
|
@ -38,9 +38,11 @@ func appStateFn(r *rand.Rand, accs []sdk.AccAddress) json.RawMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default genesis state
|
// Default genesis state
|
||||||
|
stakeGenesis := stake.DefaultGenesisState()
|
||||||
|
stakeGenesis.Pool.LooseTokens = sdk.NewRat(1000)
|
||||||
genesis := GenesisState{
|
genesis := GenesisState{
|
||||||
Accounts: genesisAccounts,
|
Accounts: genesisAccounts,
|
||||||
StakeData: stake.DefaultGenesisState(),
|
StakeData: stakeGenesis,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Marshal genesis
|
// Marshal genesis
|
||||||
|
|
|
@ -2,6 +2,7 @@ package simulation
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"math/rand"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
@ -34,8 +35,13 @@ func TestStakeWithRandomMessages(t *testing.T) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
appStateFn := func(r *rand.Rand, accs []sdk.AccAddress) json.RawMessage {
|
||||||
|
mock.RandomSetGenesis(r, mapp, accs, []string{"stake"})
|
||||||
|
return json.RawMessage("{}")
|
||||||
|
}
|
||||||
|
|
||||||
simulation.Simulate(
|
simulation.Simulate(
|
||||||
t, mapp.BaseApp, json.RawMessage("{}"),
|
t, mapp.BaseApp, appStateFn,
|
||||||
[]simulation.TestAndRunTx{
|
[]simulation.TestAndRunTx{
|
||||||
SimulateMsgCreateValidator(mapper, stakeKeeper),
|
SimulateMsgCreateValidator(mapper, stakeKeeper),
|
||||||
SimulateMsgEditValidator(stakeKeeper),
|
SimulateMsgEditValidator(stakeKeeper),
|
||||||
|
|
Loading…
Reference in New Issue