From c695ed849e5dfc735f20fd47ef8319f0292e79ac Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:01:52 +0100 Subject: [PATCH] fix(x/auth): facultative vesting as well in simulation (backport #22721) (#22726) Co-authored-by: Julien Robert --- 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) {