From 00508b61fefc77d9a4eac220756e56ec9e96611f Mon Sep 17 00:00:00 2001 From: Denali Marsh Date: Fri, 15 May 2020 15:43:52 -0700 Subject: [PATCH] Change !GTE to LT (#512) --- x/bep3/keeper/asset.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x/bep3/keeper/asset.go b/x/bep3/keeper/asset.go index adef5756..a5c65b6c 100644 --- a/x/bep3/keeper/asset.go +++ b/x/bep3/keeper/asset.go @@ -15,7 +15,7 @@ func (k Keeper) IncrementCurrentAssetSupply(ctx sdk.Context, coin sdk.Coin) erro } // Resulting current supply must be under asset's limit - if !supply.SupplyLimit.IsGTE(supply.CurrentSupply.Add(coin)) { + if supply.SupplyLimit.IsLT(supply.CurrentSupply.Add(coin)) { return sdkerrors.Wrapf(types.ErrExceedsSupplyLimit, "increase %s, asset supply %s, limit %s", coin, supply.CurrentSupply, supply.SupplyLimit) } @@ -51,7 +51,7 @@ func (k Keeper) IncrementIncomingAssetSupply(ctx sdk.Context, coin sdk.Coin) err // Result of (current + incoming + amount) must be under asset's limit totalSupply := supply.CurrentSupply.Add(supply.IncomingSupply) - if !supply.SupplyLimit.IsGTE(totalSupply.Add(coin)) { + if supply.SupplyLimit.IsLT(totalSupply.Add(coin)) { return sdkerrors.Wrapf(types.ErrExceedsSupplyLimit, "increase %s, asset supply %s, limit %s", coin, totalSupply, supply.SupplyLimit) } @@ -86,7 +86,7 @@ func (k Keeper) IncrementOutgoingAssetSupply(ctx sdk.Context, coin sdk.Coin) err } // Result of (outgoing + amount) must be less than current supply - if !supply.CurrentSupply.IsGTE(supply.OutgoingSupply.Add(coin)) { + if supply.CurrentSupply.IsLT(supply.OutgoingSupply.Add(coin)) { return sdkerrors.Wrapf(types.ErrExceedsAvailableSupply, "swap amount %s, available supply %s", coin, supply.CurrentSupply.Amount.Sub(supply.OutgoingSupply.Amount)) }