fix(x/auth): facultative vesting as well in simulation (#22721)

This commit is contained in:
Julien Robert 2024-12-03 09:32:13 +01:00 committed by GitHub
parent 1c4dc89ead
commit 4d1adcf955
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,6 +26,13 @@ func RandomGenesisAccounts(simState *module.SimulationState) types.GenesisAccoun
for i, acc := range simState.Accounts {
bacc := types.NewBaseAccountWithAddress(acc.Address)
// check if vesting module is enabled
// if not, just use base account
if _, ok := simState.GenState["vesting"]; !ok {
genesisAccs[i] = bacc
continue
}
// Only consider making a vesting account once the initial bonded validator
// set is exhausted due to needing to track DelegatedVesting.
if !(int64(i) > simState.NumBonded && simState.Rand.Intn(100) < 50) {