diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-21 01:13:30 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-21 01:13:30 +0800 |
commit | 247f8c8557a501ea5081615d9b031c9e4b7aeec7 (patch) | |
tree | 51b9a9de386d7fbe453a7fc5c1e0e827fd6ecdca /packages/order-utils/src/order_validation_utils.ts | |
parent | 3ce449e16739896f81b171d130afbb5774829d64 (diff) | |
download | dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar.gz dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar.bz2 dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar.lz dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar.xz dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.tar.zst dexon-sol-tools-247f8c8557a501ea5081615d9b031c9e4b7aeec7.zip |
Fix orderValidationUtils where was confusing a makerAssetAmount as a takerAssetAmount
Diffstat (limited to 'packages/order-utils/src/order_validation_utils.ts')
-rw-r--r-- | packages/order-utils/src/order_validation_utils.ts | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts index fb96502f2..da5b37456 100644 --- a/packages/order-utils/src/order_validation_utils.ts +++ b/packages/order-utils/src/order_validation_utils.ts @@ -54,7 +54,7 @@ export class OrderValidationUtils { senderAddress: string, zrxAssetData: string, ): Promise<void> { - const fillMakerTokenAmount = OrderValidationUtils._getPartialAmount( + const fillMakerTokenAmount = utils.getPartialAmount( fillTakerAssetAmount, signedOrder.takerAssetAmount, signedOrder.makerAssetAmount, @@ -75,7 +75,7 @@ export class OrderValidationUtils { TradeSide.Taker, TransferType.Trade, ); - const makerFeeAmount = OrderValidationUtils._getPartialAmount( + const makerFeeAmount = utils.getPartialAmount( fillTakerAssetAmount, signedOrder.takerAssetAmount, signedOrder.makerFee, @@ -88,7 +88,7 @@ export class OrderValidationUtils { TradeSide.Maker, TransferType.Fee, ); - const takerFeeAmount = OrderValidationUtils._getPartialAmount( + const takerFeeAmount = utils.getPartialAmount( fillTakerAssetAmount, signedOrder.takerAssetAmount, signedOrder.takerFee, @@ -116,13 +116,6 @@ export class OrderValidationUtils { throw new Error(ExchangeContractErrs.OrderFillExpired); } } - private static _getPartialAmount(numerator: BigNumber, denominator: BigNumber, target: BigNumber): BigNumber { - const fillMakerTokenAmount = numerator - .mul(target) - .div(denominator) - .round(0); - return fillMakerTokenAmount; - } constructor(orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher) { this._orderFilledCancelledFetcher = orderFilledCancelledFetcher; } |