fix: return if supply limit hit in issuance sims (#635)

* fix: return if supply limit hit in issuance sims
This commit is contained in:
Kevin Davis 2020-08-21 19:39:20 -04:00 committed by GitHub
parent b2eff063a8
commit fca16da84a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,8 +125,10 @@ func SimulateMsgIssueTokens(ak types.AccountKeeper, k keeper.Keeper) simulation.
maxAmount := asset.RateLimit.Limit.Sub(supply.CurrentSupply.Amount) maxAmount := asset.RateLimit.Limit.Sub(supply.CurrentSupply.Amount)
if maxAmount.IsPositive() && maxAmount.GT(sdk.OneInt()) { if maxAmount.IsPositive() && maxAmount.GT(sdk.OneInt()) {
randomAmount = simulation.RandIntBetween(r, 1, int(maxAmount.Int64())) randomAmount = simulation.RandIntBetween(r, 1, int(maxAmount.Int64()))
} else { } else if maxAmount.Equal(sdk.OneInt()) {
randomAmount = 1 randomAmount = 1
} else {
return simulation.NoOpMsg(types.ModuleName), nil, nil
} }
} }