aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-22 22:21:56 +0800
committerGitHub <noreply@github.com>2017-06-22 22:21:56 +0800
commit94cab6f694027d47971d661bca33beac42f4ade1 (patch)
treec411ec567878a8178aa64313bd9b76dfcb455fc7 /test/utils
parent25a9ba90f508e0d147c060f60a9e3683e07d45e4 (diff)
downloaddexon-sol-tools-94cab6f694027d47971d661bca33beac42f4ade1.tar
dexon-sol-tools-94cab6f694027d47971d661bca33beac42f4ade1.tar.gz
dexon-sol-tools-94cab6f694027d47971d661bca33beac42f4ade1.tar.bz2
dexon-sol-tools-94cab6f694027d47971d661bca33beac42f4ade1.tar.lz
dexon-sol-tools-94cab6f694027d47971d661bca33beac42f4ade1.tar.xz
dexon-sol-tools-94cab6f694027d47971d661bca33beac42f4ade1.tar.zst
dexon-sol-tools-94cab6f694027d47971d661bca33beac42f4ade1.zip
Revert "Use different lodash import syntax which allows to include only used functions"
Diffstat (limited to 'test/utils')
-rw-r--r--test/utils/order_factory.ts7
-rw-r--r--test/utils/token_utils.ts10
2 files changed, 7 insertions, 10 deletions
diff --git a/test/utils/order_factory.ts b/test/utils/order_factory.ts
index 939d5df20..ef19f2c4c 100644
--- a/test/utils/order_factory.ts
+++ b/test/utils/order_factory.ts
@@ -1,5 +1,4 @@
-import assign = require('lodash/assign');
-import isUndefined = require('lodash/isUndefined');
+import * as _ from 'lodash';
import * as BigNumber from 'bignumber.js';
import {ZeroEx, SignedOrder} from '../../src';
@@ -17,7 +16,7 @@ export const orderFactory = {
feeRecipient: string,
expirationUnixTimestampSec?: BigNumber.BigNumber): Promise<SignedOrder> {
const defaultExpirationUnixTimestampSec = new BigNumber(2524604400); // Close to infinite
- expirationUnixTimestampSec = isUndefined(expirationUnixTimestampSec) ?
+ expirationUnixTimestampSec = _.isUndefined(expirationUnixTimestampSec) ?
defaultExpirationUnixTimestampSec :
expirationUnixTimestampSec;
const order = {
@@ -35,7 +34,7 @@ export const orderFactory = {
};
const orderHash = await zeroEx.getOrderHashHexAsync(order);
const ecSignature = await zeroEx.signOrderHashAsync(orderHash, maker);
- const signedOrder: SignedOrder = assign(order, {ecSignature});
+ const signedOrder: SignedOrder = _.assign(order, {ecSignature});
return signedOrder;
},
};
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;