diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-07-23 12:04:49 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-07-23 23:02:51 +0800 |
commit | dcc0908617b83de8f45af3e9ca6854b897be3d72 (patch) | |
tree | 061bbbc74e77143819aca9d9de3cde59566b5972 /packages/contracts/test/utils | |
parent | 45d68285f14ba328e1bf5a8cc9e59cdb39d7f306 (diff) | |
download | dexon-sol-tools-dcc0908617b83de8f45af3e9ca6854b897be3d72.tar dexon-sol-tools-dcc0908617b83de8f45af3e9ca6854b897be3d72.tar.gz dexon-sol-tools-dcc0908617b83de8f45af3e9ca6854b897be3d72.tar.bz2 dexon-sol-tools-dcc0908617b83de8f45af3e9ca6854b897be3d72.tar.lz dexon-sol-tools-dcc0908617b83de8f45af3e9ca6854b897be3d72.tar.xz dexon-sol-tools-dcc0908617b83de8f45af3e9ca6854b897be3d72.tar.zst dexon-sol-tools-dcc0908617b83de8f45af3e9ca6854b897be3d72.zip |
Add more tests and fixes
Diffstat (limited to 'packages/contracts/test/utils')
-rw-r--r-- | packages/contracts/test/utils/forwarder_wrapper.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/contracts/test/utils/forwarder_wrapper.ts b/packages/contracts/test/utils/forwarder_wrapper.ts index 773ddf897..ef7476e36 100644 --- a/packages/contracts/test/utils/forwarder_wrapper.ts +++ b/packages/contracts/test/utils/forwarder_wrapper.ts @@ -25,13 +25,13 @@ export class ForwarderWrapper { let remainingFeeAmount = feeAmount; _.forEach(feeOrders, feeOrder => { const feeAvailable = feeOrder.makerAssetAmount.minus(feeOrder.takerFee); - if (!remainingFeeAmount.isZero() && feeAvailable.gte(remainingFeeAmount)) { + if (!remainingFeeAmount.isZero() && feeAvailable.gt(remainingFeeAmount)) { wethAmount = wethAmount .plus(feeOrder.takerAssetAmount.times(remainingFeeAmount).dividedToIntegerBy(feeAvailable)) .plus(1); remainingFeeAmount = new BigNumber(0); } else if (!remainingFeeAmount.isZero()) { - wethAmount = wethAmount.plus(feeOrder.takerAssetAmount).plus(1); + wethAmount = wethAmount.plus(feeOrder.takerAssetAmount); remainingFeeAmount = remainingFeeAmount.minus(feeAvailable); } }); |