From 4d1adcf9552d63b47a997d3d3ca0391f196f2b09 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 3 Dec 2024 09:32:13 +0100 Subject: [PATCH] fix(x/auth): facultative vesting as well in simulation (#22721) --- x/auth/simulation/genesis.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/x/auth/simulation/genesis.go b/x/auth/simulation/genesis.go index 7c18882fd325..0e9f7e93eb4a 100644 --- a/x/auth/simulation/genesis.go +++ b/x/auth/simulation/genesis.go @@ -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) {