diff options
Diffstat (limited to 'packages/order-watcher/src')
-rw-r--r-- | packages/order-watcher/src/order_watcher/order_watcher.ts | 4 | ||||
-rw-r--r-- | packages/order-watcher/src/utils/utils.ts | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index 3c93d6293..29936a066 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -60,6 +60,7 @@ interface OrderStateByOrderHash { [orderHash: string]: OrderState; } +// tslint:disable-next-line:custom-no-magic-numbers const DEFAULT_CLEANUP_JOB_INTERVAL_MS = 1000 * 60 * 60; // 1h /** @@ -130,7 +131,8 @@ export class OrderWatcher { assert.isValidSignature(orderHash, signedOrder.ecSignature, signedOrder.maker); this._orderByOrderHash[orderHash] = signedOrder; this._addToDependentOrderHashes(signedOrder, orderHash); - const expirationUnixTimestampMs = signedOrder.expirationUnixTimestampSec.times(1000); + const milisecondsInASecond = 1000; + const expirationUnixTimestampMs = signedOrder.expirationUnixTimestampSec.times(milisecondsInASecond); this._expirationWatcher.addOrder(orderHash, expirationUnixTimestampMs); } /** diff --git a/packages/order-watcher/src/utils/utils.ts b/packages/order-watcher/src/utils/utils.ts index af1125632..d34f6b99f 100644 --- a/packages/order-watcher/src/utils/utils.ts +++ b/packages/order-watcher/src/utils/utils.ts @@ -5,7 +5,8 @@ export const utils = { return new Error(`Unexpected switch value: ${value} encountered for ${name}`); }, getCurrentUnixTimestampSec(): BigNumber { - return new BigNumber(Date.now() / 1000).round(); + const milisecondsInASecond = 1000; + return new BigNumber(Date.now() / milisecondsInASecond).round(); }, getCurrentUnixTimestampMs(): BigNumber { return new BigNumber(Date.now()); |