mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 08:15:19 +00:00
fix simulation initialization
This commit is contained in:
parent
ad82e971ae
commit
8058f4b13a
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user