From 9133e764a504f07fd0059334abc5f31ee2c4c59c Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Wed, 15 Nov 2017 16:22:35 -0500 Subject: Use 18 decimal place units --- packages/0x.js/src/utils/order_state_utils.ts | 4 ++-- packages/0x.js/test/order_state_watcher_test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/0x.js/src/utils/order_state_utils.ts b/packages/0x.js/src/utils/order_state_utils.ts index d1b2feb43..c68eaf85d 100644 --- a/packages/0x.js/src/utils/order_state_utils.ts +++ b/packages/0x.js/src/utils/order_state_utils.ts @@ -116,12 +116,12 @@ export class OrderStateUtils { return BigNumber.min(makerTransferrable, remainingMakerAmount); } const orderToFeeRatio = totalMakerAmount.dividedToIntegerBy(makerFee); - console.log('order to fee ratio: ', orderToFeeRatio.toString()); let fillableTimesInMakerToken = makerTransferrable.dividedToIntegerBy(orderToFeeRatio); const fillableTimesInFeeToken = BigNumber.min(makerFeeTransferrable, remainingMakerFee); if (makerTokenAddress === zrxTokenAddress) { fillableTimesInMakerToken = makerTransferrable.plus(makerFeeTransferrable) - .dividedToIntegerBy(orderToFeeRatio.plus(new BigNumber(1))); + .dividedToIntegerBy(orderToFeeRatio.plus( + ZeroEx.toBaseUnitAmount(new BigNumber(1), 18))); } return BigNumber.min(fillableTimesInMakerToken.times(orderToFeeRatio), diff --git a/packages/0x.js/test/order_state_watcher_test.ts b/packages/0x.js/test/order_state_watcher_test.ts index fef7b5d13..9d432a713 100644 --- a/packages/0x.js/test/order_state_watcher_test.ts +++ b/packages/0x.js/test/order_state_watcher_test.ts @@ -235,7 +235,7 @@ describe('OrderStateWatcher', () => { ); })().catch(done); }); - describe.only('remainingFillable(M|T)akerTokenAmount', () => { + describe('remainingFillable(M|T)akerTokenAmount', () => { it('should calculate correct remaining fillable', (done: DoneCallback) => { (async () => { const takerFillableAmount = ZeroEx.toBaseUnitAmount(new BigNumber(10), 18); -- cgit