Add etherToken.getLogsAsync and etherToken.subscribe with tests

This commit is contained in:
Leonid Logvinov
2017-12-19 14:15:14 +01:00
parent b603197ae8
commit 613fada49f
8 changed files with 274 additions and 8 deletions

View File

@@ -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);