mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 00:05:18 +00:00
fix: return if supply limit hit in issuance sims (#635)
* fix: return if supply limit hit in issuance sims
This commit is contained in:
parent
b2eff063a8
commit
fca16da84a
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user