From fd9f322b8c6557b413a81c945ec5ea3c0f592281 Mon Sep 17 00:00:00 2001 From: Nicolas Pinto Date: Fri, 17 May 2019 13:51:55 -0700 Subject: [PATCH] Merge PR #4363: invalid 0stake deposit amount in sim This fixes the "panic: Governance deposit amount must be a valid sdk.Coins amount, is 0stake" that can happen in the simulator if `DepositParams/MinDeposit` samples the integer `0`. --- x/simulation/params.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/simulation/params.go b/x/simulation/params.go index 11b43d69d..81bdd6e37 100644 --- a/x/simulation/params.go +++ b/x/simulation/params.go @@ -56,7 +56,7 @@ var ( return uint64(RandIntBetween(r, 500, 1000)) }, "DepositParams/MinDeposit": func(r *rand.Rand) interface{} { - return sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, int64(r.Intn(1e3)))} + return sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, int64(RandIntBetween(r, 1, 1e3)))} }, "VotingParams/VotingPeriod": func(r *rand.Rand) interface{} { return time.Duration(r.Intn(2*172800)) * time.Second