aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils/token_utils.ts
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-23 04:50:16 +0800
committerGitHub <noreply@github.com>2017-06-23 04:50:16 +0800
commite5785532ed1f4cada70db7815a44ffdd005077f5 (patch)
treeda804f637b18b8589be98d81b34b26cbfc2b9032 /test/utils/token_utils.ts
parentbd9fa3d335afdd0cd8b573f60b3ce3c0db6ad4dd (diff)
parent49e43c98767666fcf457edfe2f3cbe098d12b6a5 (diff)
downloaddexon-sol-tools-e5785532ed1f4cada70db7815a44ffdd005077f5.tar
dexon-sol-tools-e5785532ed1f4cada70db7815a44ffdd005077f5.tar.gz
dexon-sol-tools-e5785532ed1f4cada70db7815a44ffdd005077f5.tar.bz2
dexon-sol-tools-e5785532ed1f4cada70db7815a44ffdd005077f5.tar.lz
dexon-sol-tools-e5785532ed1f4cada70db7815a44ffdd005077f5.tar.xz
dexon-sol-tools-e5785532ed1f4cada70db7815a44ffdd005077f5.tar.zst
dexon-sol-tools-e5785532ed1f4cada70db7815a44ffdd005077f5.zip
Merge branch 'master' into fill-order-amuont
Diffstat (limited to 'test/utils/token_utils.ts')
-rw-r--r--test/utils/token_utils.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/utils/token_utils.ts b/test/utils/token_utils.ts
index 00fa55260..f4fa7ac31 100644
--- a/test/utils/token_utils.ts
+++ b/test/utils/token_utils.ts
@@ -1,6 +1,4 @@
-import find = require('lodash/find');
-import filter = require('lodash/filter');
-import isUndefined = require('lodash/isUndefined');
+import * as _ from 'lodash';
import {Token, ZeroExError} from '../../src';
const PROTOCOL_TOKEN_SYMBOL = 'ZRX';
@@ -11,14 +9,14 @@ export class TokenUtils {
this.tokens = tokens;
}
public getProtocolTokenOrThrow(): Token {
- const zrxToken = find(this.tokens, {symbol: PROTOCOL_TOKEN_SYMBOL});
- if (isUndefined(zrxToken)) {
+ const zrxToken = _.find(this.tokens, {symbol: PROTOCOL_TOKEN_SYMBOL});
+ if (_.isUndefined(zrxToken)) {
throw new Error(ZeroExError.ZRX_NOT_IN_TOKEN_REGISTRY);
}
return zrxToken;
}
public getNonProtocolTokens(): Token[] {
- const nonProtocolTokens = filter(this.tokens, token => {
+ const nonProtocolTokens = _.filter(this.tokens, token => {
return token.symbol !== PROTOCOL_TOKEN_SYMBOL;
});
return nonProtocolTokens;