diff --git a/x/dex/keeper/cancel_limit_order.go b/x/dex/keeper/cancel_limit_order.go index 44167151a..8c3af443e 100644 --- a/x/dex/keeper/cancel_limit_order.go +++ b/x/dex/keeper/cancel_limit_order.go @@ -84,7 +84,7 @@ func (k Keeper) ExecuteCancelLimitOrder( tranche.TotalMakerDenom = tranche.TotalMakerDenom.Sub(trancheUser.SharesOwned) tranche.TotalTakerDenom = tranche.TotalTakerDenom.Sub(takerAmountOut) - if !makerAmountToReturn.IsPositive() || !takerAmountOut.IsPositive() { + if !makerAmountToReturn.IsPositive() && !takerAmountOut.IsPositive() { return sdk.Coin{}, sdk.Coin{}, nil, sdkerrors.Wrapf(types.ErrCancelEmptyLimitOrder, "%s", tranche.Key.TrancheKey) } diff --git a/x/dex/keeper/limit_order_tranche_user_test.go b/x/dex/keeper/limit_order_tranche_user_test.go index b4e5cd563..a5578ee43 100644 --- a/x/dex/keeper/limit_order_tranche_user_test.go +++ b/x/dex/keeper/limit_order_tranche_user_test.go @@ -91,6 +91,7 @@ func (s *DexTestSuite) TestGetAllLimitOrders() { Address: s.alice.String(), SharesOwned: math.NewInt(10_000_000), SharesWithdrawn: math.NewInt(0), + SharesCancelled: math.ZeroInt(), }, LOList[0], ) @@ -101,6 +102,7 @@ func (s *DexTestSuite) TestGetAllLimitOrders() { Address: s.alice.String(), SharesOwned: math.NewInt(10_000_000), SharesWithdrawn: math.NewInt(0), + SharesCancelled: math.ZeroInt(), }, LOList[1], )