From dcc0908617b83de8f45af3e9ca6854b897be3d72 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Sun, 22 Jul 2018 23:04:49 -0500 Subject: Add more tests and fixes --- packages/contracts/test/utils/forwarder_wrapper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/contracts/test/utils/forwarder_wrapper.ts') 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); } }); -- cgit v1.2.3