From 9778695b4ad1fd999eb79b01c768a2f2b9938917 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 4 Jun 2018 19:48:21 -0700 Subject: Try enabling no-unused-variable... --- packages/order-watcher/src/order_watcher/order_watcher.ts | 2 +- packages/order-watcher/src/types.ts | 9 --------- packages/order-watcher/src/utils/assert.ts | 3 --- 3 files changed, 1 insertion(+), 13 deletions(-) (limited to 'packages/order-watcher/src') diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index 29936a066..c1f6c9230 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 { AbiDecoder, intervalUtils } from '@0xproject/utils'; +import { intervalUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; diff --git a/packages/order-watcher/src/types.ts b/packages/order-watcher/src/types.ts index 9125af236..b6a1115bd 100644 --- a/packages/order-watcher/src/types.ts +++ b/packages/order-watcher/src/types.ts @@ -1,17 +1,8 @@ -import { BigNumber } from '@0xproject/utils'; import { - BlockParam, BlockParamLiteral, - ContractAbi, - ContractEventArg, - ExchangeContractErrs, - FilterObject, LogEntryEvent, - LogWithDecodedArgs, - Order, OrderState, - SignedOrder, } from '@0xproject/types'; export enum OrderWatcherError { diff --git a/packages/order-watcher/src/utils/assert.ts b/packages/order-watcher/src/utils/assert.ts index 9e02f8bdc..e88f9ac72 100644 --- a/packages/order-watcher/src/utils/assert.ts +++ b/packages/order-watcher/src/utils/assert.ts @@ -4,9 +4,6 @@ import { assert as sharedAssert } from '@0xproject/assert'; import { Schema } from '@0xproject/json-schemas'; // tslint:disable-next-line:no-unused-variable import { ECSignature } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; -import { Web3Wrapper } from '@0xproject/web3-wrapper'; -import * as _ from 'lodash'; import { isValidSignature } from '@0xproject/order-utils'; -- cgit v1.2.3 From cf8fdd3a701f21bfc3b2ec8397fa65948f5cdc78 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 6 Jun 2018 16:26:04 +0200 Subject: Move spawnSwitchErr to @0xproject/utils --- packages/order-watcher/src/order_watcher/order_watcher.ts | 4 ++-- packages/order-watcher/src/utils/utils.ts | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'packages/order-watcher/src') diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index 29936a066..498ec5357 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 { AbiDecoder, intervalUtils } from '@0xproject/utils'; +import { AbiDecoder, errorUtils, intervalUtils } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; @@ -344,7 +344,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 { 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(); -- cgit v1.2.3 From a97d77064aacda3de74b04894f110b05298c5ca8 Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 6 Jun 2018 15:26:40 -0700 Subject: Get build and tests to pass --- packages/order-watcher/src/utils/assert.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/order-watcher/src') diff --git a/packages/order-watcher/src/utils/assert.ts b/packages/order-watcher/src/utils/assert.ts index e88f9ac72..5d7f72716 100644 --- a/packages/order-watcher/src/utils/assert.ts +++ b/packages/order-watcher/src/utils/assert.ts @@ -1,9 +1,10 @@ import { assert as sharedAssert } from '@0xproject/assert'; // We need those two unused imports because they're actually used by sharedAssert which gets injected here -// tslint:disable-next-line:no-unused-variable +// tslint:disable:no-unused-variable import { Schema } from '@0xproject/json-schemas'; -// tslint:disable-next-line:no-unused-variable import { ECSignature } from '@0xproject/types'; +import { BigNumber } from '@0xproject/utils'; +// tslint:enable:no-unused-variable import { isValidSignature } from '@0xproject/order-utils'; -- cgit v1.2.3 From 870eca0d9f875f784c1847993246db3097f68405 Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 6 Jun 2018 16:59:28 -0700 Subject: Run prettier --- packages/order-watcher/src/types.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'packages/order-watcher/src') diff --git a/packages/order-watcher/src/types.ts b/packages/order-watcher/src/types.ts index b6a1115bd..f5b189c5a 100644 --- a/packages/order-watcher/src/types.ts +++ b/packages/order-watcher/src/types.ts @@ -1,9 +1,4 @@ - -import { - BlockParamLiteral, - LogEntryEvent, - OrderState, -} from '@0xproject/types'; +import { BlockParamLiteral, LogEntryEvent, OrderState } from '@0xproject/types'; export enum OrderWatcherError { SubscriptionAlreadyPresent = 'SUBSCRIPTION_ALREADY_PRESENT', -- cgit v1.2.3 From 62a5cbb5ceff7525d88d297cd92de82c996bec7a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Thu, 7 Jun 2018 21:15:12 +0200 Subject: Fix linter issue --- packages/order-watcher/src/order_watcher/order_watcher.ts | 1 - 1 file changed, 1 deletion(-) (limited to 'packages/order-watcher/src') diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index f25076213..140aa341b 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -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'; -- cgit v1.2.3 From e1879ef4d91fc58203d9748eca38695b79c43674 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 11 Jun 2018 23:42:30 +0200 Subject: Fix no-unused-variable tslint rule to include parameters and fix issues --- packages/order-watcher/src/order_watcher/expiration_watcher.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/order-watcher/src') 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; -- cgit v1.2.3