aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-09-26 17:51:51 +0800
committerFabio Berger <me@fabioberger.com>2017-09-26 17:51:51 +0800
commit9effd572298a9e758078c512eabacc4573524efe (patch)
tree21e7ac025a6202e8ae8b87a72a0b4d27dc445e2b /src
parent5e6c4e0ec37e7fb6b4214f331761690943552fd3 (diff)
downloaddexon-sol-tools-9effd572298a9e758078c512eabacc4573524efe.tar
dexon-sol-tools-9effd572298a9e758078c512eabacc4573524efe.tar.gz
dexon-sol-tools-9effd572298a9e758078c512eabacc4573524efe.tar.bz2
dexon-sol-tools-9effd572298a9e758078c512eabacc4573524efe.tar.lz
dexon-sol-tools-9effd572298a9e758078c512eabacc4573524efe.tar.xz
dexon-sol-tools-9effd572298a9e758078c512eabacc4573524efe.tar.zst
dexon-sol-tools-9effd572298a9e758078c512eabacc4573524efe.zip
Fix bug where we were accidentally comparing a makerTokenAmount to a takerTokenAmount
Diffstat (limited to 'src')
-rw-r--r--src/utils/order_validation_utils.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/order_validation_utils.ts b/src/utils/order_validation_utils.ts
index 27fc72dca..a7c487cf2 100644
--- a/src/utils/order_validation_utils.ts
+++ b/src/utils/order_validation_utils.ts
@@ -18,7 +18,7 @@ export class OrderValidationUtils {
): Promise<void> {
const orderHash = utils.getOrderHashHex(signedOrder);
const unavailableTakerTokenAmount = await this.exchangeWrapper.getUnavailableTakerAmountAsync(orderHash);
- if (signedOrder.makerTokenAmount.eq(unavailableTakerTokenAmount)) {
+ if (signedOrder.takerTokenAmount.eq(unavailableTakerTokenAmount)) {
throw new Error(ExchangeContractErrs.OrderRemainingFillAmountZero);
}
const currentUnixTimestampSec = utils.getCurrentUnixTimestamp();
@@ -45,7 +45,7 @@ export class OrderValidationUtils {
throw new Error(ZeroExError.InvalidSignature);
}
const unavailableTakerTokenAmount = await this.exchangeWrapper.getUnavailableTakerAmountAsync(orderHash);
- if (signedOrder.makerTokenAmount.eq(unavailableTakerTokenAmount)) {
+ if (signedOrder.takerTokenAmount.eq(unavailableTakerTokenAmount)) {
throw new Error(ExchangeContractErrs.OrderRemainingFillAmountZero);
}
if (signedOrder.taker !== constants.NULL_ADDRESS && signedOrder.taker !== takerAddress) {