diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-24 23:46:58 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-24 23:46:58 +0800 |
commit | 38f47a380b663df0a3f817100650e222dd7582e0 (patch) | |
tree | 23348daa23207b840b93335bfb823d451053ab53 /packages/contracts/test/utils/forwarder_wrapper.ts | |
parent | 4c4286ac662d3dba928bf16b83ade5e5476f4614 (diff) | |
parent | 8635f8d7325d472dd7d4fac26f1a87bee17edd1a (diff) | |
download | dexon-0x-contracts-38f47a380b663df0a3f817100650e222dd7582e0.tar dexon-0x-contracts-38f47a380b663df0a3f817100650e222dd7582e0.tar.gz dexon-0x-contracts-38f47a380b663df0a3f817100650e222dd7582e0.tar.bz2 dexon-0x-contracts-38f47a380b663df0a3f817100650e222dd7582e0.tar.lz dexon-0x-contracts-38f47a380b663df0a3f817100650e222dd7582e0.tar.xz dexon-0x-contracts-38f47a380b663df0a3f817100650e222dd7582e0.tar.zst dexon-0x-contracts-38f47a380b663df0a3f817100650e222dd7582e0.zip |
Merge branch 'development' into feature/instant/processing-state
Diffstat (limited to 'packages/contracts/test/utils/forwarder_wrapper.ts')
-rw-r--r-- | packages/contracts/test/utils/forwarder_wrapper.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/contracts/test/utils/forwarder_wrapper.ts b/packages/contracts/test/utils/forwarder_wrapper.ts index f1a64d47d..a0bfcfe1d 100644 --- a/packages/contracts/test/utils/forwarder_wrapper.ts +++ b/packages/contracts/test/utils/forwarder_wrapper.ts @@ -26,9 +26,12 @@ export class ForwarderWrapper { _.forEach(feeOrders, feeOrder => { const feeAvailable = feeOrder.makerAssetAmount.minus(feeOrder.takerFee); if (!remainingFeeAmount.isZero() && feeAvailable.gt(remainingFeeAmount)) { - wethAmount = wethAmount - .plus(feeOrder.takerAssetAmount.times(remainingFeeAmount).dividedToIntegerBy(feeAvailable)) - .plus(1); + wethAmount = wethAmount.plus( + feeOrder.takerAssetAmount + .times(remainingFeeAmount) + .dividedBy(feeAvailable) + .ceil(), + ); remainingFeeAmount = new BigNumber(0); } else if (!remainingFeeAmount.isZero()) { wethAmount = wethAmount.plus(feeOrder.takerAssetAmount); |