aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-watcher/src
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-06-13 05:01:19 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-06-13 05:01:19 +0800
commit39692a8b3fd69e5b37e2de568ee74766840ad4b8 (patch)
treecc2d1ec295d987a360ce07a5c80723b96b0d1816 /packages/order-watcher/src
parent2af6d3f6bc03932f53d199971694c3c0d9441ba8 (diff)
parent787015f5370718e31c7990446fb1da298ed13e6b (diff)
downloaddexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar
dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar.gz
dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar.bz2
dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar.lz
dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar.xz
dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.tar.zst
dexon-sol-tools-39692a8b3fd69e5b37e2de568ee74766840ad4b8.zip
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/onboarding-flow-allowances
Diffstat (limited to 'packages/order-watcher/src')
-rw-r--r--packages/order-watcher/src/order_watcher/expiration_watcher.ts2
-rw-r--r--packages/order-watcher/src/order_watcher/order_watcher.ts5
-rw-r--r--packages/order-watcher/src/utils/utils.ts3
3 files changed, 4 insertions, 6 deletions
diff --git a/packages/order-watcher/src/order_watcher/expiration_watcher.ts b/packages/order-watcher/src/order_watcher/expiration_watcher.ts
index ec2c1ec35..31fda7dca 100644
--- a/packages/order-watcher/src/order_watcher/expiration_watcher.ts
+++ b/packages/order-watcher/src/order_watcher/expiration_watcher.ts
@@ -19,6 +19,8 @@ export class ExpirationWatcher {
private _expirationMarginMs: number;
private _orderExpirationCheckingIntervalIdIfExists?: NodeJS.Timer;
constructor(expirationMarginIfExistsMs?: number, orderExpirationCheckingIntervalIfExistsMs?: number) {
+ this._orderExpirationCheckingIntervalMs =
+ orderExpirationCheckingIntervalIfExistsMs || DEFAULT_ORDER_EXPIRATION_CHECKING_INTERVAL_MS;
this._expirationMarginMs = expirationMarginIfExistsMs || DEFAULT_EXPIRATION_MARGIN_MS;
this._orderExpirationCheckingIntervalMs =
expirationMarginIfExistsMs || DEFAULT_ORDER_EXPIRATION_CHECKING_INTERVAL_MS;
diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts
index c1f6c9230..140aa341b 100644
--- a/packages/order-watcher/src/order_watcher/order_watcher.ts
+++ b/packages/order-watcher/src/order_watcher/order_watcher.ts
@@ -14,7 +14,7 @@ import {
Provider,
SignedOrder,
} from '@0xproject/types';
-import { intervalUtils } from '@0xproject/utils';
+import { errorUtils, intervalUtils } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
@@ -39,7 +39,6 @@ import {
} from '../generated_contract_wrappers/token';
import { OnOrderStateChangeCallback, OrderWatcherConfig, OrderWatcherError } from '../types';
import { assert } from '../utils/assert';
-import { utils } from '../utils/utils';
import { EventWatcher } from './event_watcher';
import { ExpirationWatcher } from './expiration_watcher';
@@ -344,7 +343,7 @@ export class OrderWatcher {
return; // noop
default:
- throw utils.spawnSwitchErr('decodedLog.event', decodedLog.event);
+ throw errorUtils.spawnSwitchErr('decodedLog.event', decodedLog.event);
}
}
private async _emitRevalidateOrdersAsync(orderHashes: string[]): Promise<void> {
diff --git a/packages/order-watcher/src/utils/utils.ts b/packages/order-watcher/src/utils/utils.ts
index d34f6b99f..087fc635e 100644
--- a/packages/order-watcher/src/utils/utils.ts
+++ b/packages/order-watcher/src/utils/utils.ts
@@ -1,9 +1,6 @@
import { BigNumber } from '@0xproject/utils';
export const utils = {
- spawnSwitchErr(name: string, value: any): Error {
- return new Error(`Unexpected switch value: ${value} encountered for ${name}`);
- },
getCurrentUnixTimestampSec(): BigNumber {
const milisecondsInASecond = 1000;
return new BigNumber(Date.now() / milisecondsInASecond).round();