Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcompagni10 committed Jul 31, 2024
1 parent baed57e commit 0bb45f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x/dex/keeper/cancel_limit_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 2 additions & 0 deletions x/dex/keeper/limit_order_tranche_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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],
)
Expand All @@ -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],
)
Expand Down

0 comments on commit 0bb45f7

Please sign in to comment.