Skip to content

Commit

Permalink
Merge PR #4363: invalid 0stake deposit amount in sim
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
npinto authored and alexanderbez committed May 17, 2019
1 parent 3153e93 commit fd9f322
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x/simulation/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd9f322

Please sign in to comment.