From 613fada49f9d168fb949a370b884367f99deb401 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 19 Dec 2017 14:15:14 +0100 Subject: Add etherToken.getLogsAsync and etherToken.subscribe with tests --- packages/0x.js/test/utils/token_utils.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'packages/0x.js/test/utils') diff --git a/packages/0x.js/test/utils/token_utils.ts b/packages/0x.js/test/utils/token_utils.ts index 4634899a7..7da7f466c 100644 --- a/packages/0x.js/test/utils/token_utils.ts +++ b/packages/0x.js/test/utils/token_utils.ts @@ -17,6 +17,13 @@ export class TokenUtils { } return zrxToken; } + public getWethTokenOrThrow(): Token { + const wethToken = _.find(this.tokens, {symbol: WETH_TOKEN_SYMBOL}); + if (_.isUndefined(wethToken)) { + throw new Error(InternalZeroExError.WethNotInTokenRegistry); + } + return wethToken; + } public getDummyTokens(): Token[] { const dummyTokens = _.filter(this.tokens, token => { return !_.includes([PROTOCOL_TOKEN_SYMBOL, WETH_TOKEN_SYMBOL], token.symbol); -- cgit v1.2.3