From dc3756bc992b2db4eb26935f8861123ed76189e6 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Wed, 23 Aug 2017 18:29:24 +0200 Subject: Simplify the validation check for ExchangeContractErrs.OrderAlreadyCancelledOrFilled --- src/utils/order_validation_utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/utils/order_validation_utils.ts b/src/utils/order_validation_utils.ts index 379ff5fdf..6f9cd7b1a 100644 --- a/src/utils/order_validation_utils.ts +++ b/src/utils/order_validation_utils.ts @@ -58,7 +58,7 @@ export class OrderValidationUtils { if (cancelTakerTokenAmount.eq(0)) { throw new Error(ExchangeContractErrs.OrderCancelAmountZero); } - if (order.takerTokenAmount.minus(unavailableTakerTokenAmount).eq(0)) { + if (order.takerTokenAmount.eq(unavailableTakerTokenAmount)) { throw new Error(ExchangeContractErrs.OrderAlreadyCancelledOrFilled); } const currentUnixTimestampSec = utils.getCurrentUnixTimestamp(); -- cgit v1.2.3