fix simulation initialization

This commit is contained in:
Kevin Davis 2019-10-04 15:46:41 -04:00
parent ad82e971ae
commit 8058f4b13a

View File

@ -45,7 +45,13 @@ func RandomizedGenState(simState *module.SimulationState) {
panic(err) panic(err)
} }
} else { } else {
consAdd := getRandomValidatorConsAddr(simState, simulation.RandIntBetween(simState.Rand, 0, int(simState.NumBonded)-1)) var val int
if simState.NumBonded <= 1 {
val = 0
} else {
val = simulation.RandIntBetween(simState.Rand, 0, int(simState.NumBonded)-1)
}
consAdd := getRandomValidatorConsAddr(simState, val)
// convert to validator vesting account 50% // convert to validator vesting account 50%
// set signing threshold to be anywhere between 1 and 100 // set signing threshold to be anywhere between 1 and 100
gacc = types.NewValidatorVestingAccountRaw( gacc = types.NewValidatorVestingAccountRaw(