From a907df048b8cc12bfc294dfa1bc794fc61bad00b Mon Sep 17 00:00:00 2001 From: Adam Tucker Date: Tue, 1 Aug 2023 07:54:20 -0500 Subject: [PATCH] prevent sim from starting with zero validators (#5935) --- tests/simulator/state.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/simulator/state.go b/tests/simulator/state.go index f078fe8e887..1f50601cb83 100644 --- a/tests/simulator/state.go +++ b/tests/simulator/state.go @@ -136,7 +136,8 @@ func AppStateRandomizedFn( // generate a random amount of initial stake coins and a random initial // number of bonded accounts initialStake := r.Int63n(1e12) - numInitiallyBonded := int64(r.Intn(300)) + // Don't allow 0 validators to start off with + numInitiallyBonded := int64(rand.Intn(299)) + 1 if numInitiallyBonded > numAccs { numInitiallyBonded = numAccs