From 95e9f33f6aa5fa7849279062b008afa763a465d8 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 13 Jul 2018 17:45:25 +0200 Subject: Migrate order-watcher to v2 --- packages/order-watcher/test/utils/token_utils.ts | 34 ----------------------- packages/order-watcher/test/utils/web3_wrapper.ts | 2 +- 2 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 packages/order-watcher/test/utils/token_utils.ts (limited to 'packages/order-watcher/test/utils') diff --git a/packages/order-watcher/test/utils/token_utils.ts b/packages/order-watcher/test/utils/token_utils.ts deleted file mode 100644 index e1191b5bb..000000000 --- a/packages/order-watcher/test/utils/token_utils.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Token } from '@0xproject/types'; -import * as _ from 'lodash'; - -import { InternalOrderWatcherError } from '../../src/types'; - -const PROTOCOL_TOKEN_SYMBOL = 'ZRX'; -const WETH_TOKEN_SYMBOL = 'WETH'; - -export class TokenUtils { - private _tokens: Token[]; - constructor(tokens: Token[]) { - this._tokens = tokens; - } - public getProtocolTokenOrThrow(): Token { - const zrxToken = _.find(this._tokens, { symbol: PROTOCOL_TOKEN_SYMBOL }); - if (_.isUndefined(zrxToken)) { - throw new Error(InternalOrderWatcherError.ZrxNotInTokenRegistry); - } - return zrxToken; - } - public getWethTokenOrThrow(): Token { - const wethToken = _.find(this._tokens, { symbol: WETH_TOKEN_SYMBOL }); - if (_.isUndefined(wethToken)) { - throw new Error(InternalOrderWatcherError.WethNotInTokenRegistry); - } - return wethToken; - } - public getDummyTokens(): Token[] { - const dummyTokens = _.filter(this._tokens, token => { - return !_.includes([PROTOCOL_TOKEN_SYMBOL, WETH_TOKEN_SYMBOL], token.symbol); - }); - return dummyTokens; - } -} diff --git a/packages/order-watcher/test/utils/web3_wrapper.ts b/packages/order-watcher/test/utils/web3_wrapper.ts index f7d11f138..ab801fa7f 100644 --- a/packages/order-watcher/test/utils/web3_wrapper.ts +++ b/packages/order-watcher/test/utils/web3_wrapper.ts @@ -1,6 +1,6 @@ import { web3Factory } from '@0xproject/dev-utils'; -import { Provider } from '@0xproject/types'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; +import { Provider } from 'ethereum-types'; const provider: Provider = web3Factory.getRpcProvider({ shouldUseInProcessGanache: true }); const web3Wrapper = new Web3Wrapper(provider); -- cgit v1.2.3