diff options
Diffstat (limited to 'packages/order-watcher')
-rw-r--r-- | packages/order-watcher/CHANGELOG.json | 9 | ||||
-rw-r--r-- | packages/order-watcher/package.json | 2 | ||||
-rw-r--r-- | packages/order-watcher/src/order_watcher/expiration_watcher.ts | 2 | ||||
-rw-r--r-- | packages/order-watcher/src/utils/utils.ts | 2 | ||||
-rw-r--r-- | packages/order-watcher/test/order_watcher_test.ts | 6 |
5 files changed, 15 insertions, 6 deletions
diff --git a/packages/order-watcher/CHANGELOG.json b/packages/order-watcher/CHANGELOG.json index 29fe4e723..585bb48e6 100644 --- a/packages/order-watcher/CHANGELOG.json +++ b/packages/order-watcher/CHANGELOG.json @@ -1,5 +1,14 @@ [ { + "version": "3.0.0", + "changes": [ + { + "note": "Upgrade the bignumber.js to v8.0.2", + "pr": 1517 + } + ] + }, + { "timestamp": 1547747677, "version": "2.4.3", "changes": [ diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json index 0f2464eae..895c64813 100644 --- a/packages/order-watcher/package.json +++ b/packages/order-watcher/package.json @@ -49,7 +49,7 @@ "@types/sinon": "^2.2.2", "chai": "^4.0.1", "chai-as-promised": "^7.1.0", - "chai-bignumber": "^2.0.1", + "chai-bignumber": "^3.0.0", "dirty-chai": "^2.0.1", "make-promises-safe": "^1.1.0", "mocha": "^4.1.0", diff --git a/packages/order-watcher/src/order_watcher/expiration_watcher.ts b/packages/order-watcher/src/order_watcher/expiration_watcher.ts index ad20a6e3f..82590efde 100644 --- a/packages/order-watcher/src/order_watcher/expiration_watcher.ts +++ b/packages/order-watcher/src/order_watcher/expiration_watcher.ts @@ -73,7 +73,7 @@ export class ExpirationWatcher { break; } const nextOrderHashToExpire = this._orderHashByExpirationRBTree.min(); - const hasNoExpiredOrders = this._expiration[nextOrderHashToExpire].greaterThan( + const hasNoExpiredOrders = this._expiration[nextOrderHashToExpire].isGreaterThan( currentUnixTimestampMs.plus(this._expirationMarginMs), ); const isSubscriptionActive = _.isUndefined(this._orderExpirationCheckingIntervalIdIfExists); diff --git a/packages/order-watcher/src/utils/utils.ts b/packages/order-watcher/src/utils/utils.ts index a7d10aaf9..9c3849ff1 100644 --- a/packages/order-watcher/src/utils/utils.ts +++ b/packages/order-watcher/src/utils/utils.ts @@ -3,7 +3,7 @@ import { BigNumber } from '@0x/utils'; export const utils = { getCurrentUnixTimestampSec(): BigNumber { const milisecondsInASecond = 1000; - return new BigNumber(Date.now() / milisecondsInASecond).round(); + return new BigNumber(Date.now() / milisecondsInASecond).integerValue(); }, getCurrentUnixTimestampMs(): BigNumber { return new BigNumber(Date.now()); diff --git a/packages/order-watcher/test/order_watcher_test.ts b/packages/order-watcher/test/order_watcher_test.ts index 41dc884d5..28b564b32 100644 --- a/packages/order-watcher/test/order_watcher_test.ts +++ b/packages/order-watcher/test/order_watcher_test.ts @@ -317,7 +317,7 @@ describe('OrderWatcher', () => { const validOrderState = orderState as OrderStateValid; expect(validOrderState.orderHash).to.be.equal(orderHash); const orderRelevantState = validOrderState.orderRelevantState; - const remainingMakerBalance = makerBalance.sub(fillAmountInBaseUnits); + const remainingMakerBalance = makerBalance.minus(fillAmountInBaseUnits); const remainingFillable = fillableAmount.minus(fillAmountInBaseUnits); expect(orderRelevantState.remainingFillableMakerAssetAmount).to.be.bignumber.equal( remainingFillable, @@ -434,7 +434,7 @@ describe('OrderWatcher', () => { ); const remainingAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(1), decimals); - const transferAmount = makerBalance.sub(remainingAmount); + const transferAmount = makerBalance.minus(remainingAmount); await orderWatcher.addOrderAsync(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { @@ -475,7 +475,7 @@ describe('OrderWatcher', () => { const remainingFeeAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(3), decimals); const remainingTokenAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(4), decimals); - const transferTokenAmount = makerFee.sub(remainingTokenAmount); + const transferTokenAmount = makerFee.minus(remainingTokenAmount); await orderWatcher.addOrderAsync(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { |