From fca16da84ad3debc78bf3d01172c55c04010d983 Mon Sep 17 00:00:00 2001 From: Kevin Davis Date: Fri, 21 Aug 2020 19:39:20 -0400 Subject: [PATCH] fix: return if supply limit hit in issuance sims (#635) * fix: return if supply limit hit in issuance sims --- x/issuance/simulation/operations.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/x/issuance/simulation/operations.go b/x/issuance/simulation/operations.go index 9cf6bb89..b8352481 100644 --- a/x/issuance/simulation/operations.go +++ b/x/issuance/simulation/operations.go @@ -125,8 +125,10 @@ func SimulateMsgIssueTokens(ak types.AccountKeeper, k keeper.Keeper) simulation. maxAmount := asset.RateLimit.Limit.Sub(supply.CurrentSupply.Amount) if maxAmount.IsPositive() && maxAmount.GT(sdk.OneInt()) { randomAmount = simulation.RandIntBetween(r, 1, int(maxAmount.Int64())) - } else { + } else if maxAmount.Equal(sdk.OneInt()) { randomAmount = 1 + } else { + return simulation.NoOpMsg(types.ModuleName), nil, nil } }