aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/test/utils/token_utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/0x.js/test/utils/token_utils.ts')
-rw-r--r--packages/0x.js/test/utils/token_utils.ts7
1 files changed, 7 insertions, 0 deletions
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);