aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-watcher
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2019-01-14 22:50:32 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2019-01-15 23:25:24 +0800
commitc3afc13dd660348e99b727c2dd01930eec8d99c3 (patch)
tree9a05e88e55200fdf72d08af10b5a753535e23256 /packages/order-watcher
parentf570f80674c22f69712c45e8e3c48e948b51f357 (diff)
downloaddexon-sol-tools-c3afc13dd660348e99b727c2dd01930eec8d99c3.tar
dexon-sol-tools-c3afc13dd660348e99b727c2dd01930eec8d99c3.tar.gz
dexon-sol-tools-c3afc13dd660348e99b727c2dd01930eec8d99c3.tar.bz2
dexon-sol-tools-c3afc13dd660348e99b727c2dd01930eec8d99c3.tar.lz
dexon-sol-tools-c3afc13dd660348e99b727c2dd01930eec8d99c3.tar.xz
dexon-sol-tools-c3afc13dd660348e99b727c2dd01930eec8d99c3.tar.zst
dexon-sol-tools-c3afc13dd660348e99b727c2dd01930eec8d99c3.zip
Upgrade bignumber.js version
Diffstat (limited to 'packages/order-watcher')
-rw-r--r--packages/order-watcher/src/order_watcher/expiration_watcher.ts2
-rw-r--r--packages/order-watcher/src/utils/utils.ts2
-rw-r--r--packages/order-watcher/test/order_watcher_test.ts6
3 files changed, 5 insertions, 5 deletions
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) => {