aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-01 21:46:27 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-01 21:46:27 +0800
commitd8e35c364ea94b606810b340fb02d8706e257c3c (patch)
tree93e3f7ae35178d99efdb82b1f58c0f3c162f9615 /test/utils
parent21d00f04d46a8067801ff539fb21cbbed416c8b3 (diff)
downloaddexon-sol-tools-d8e35c364ea94b606810b340fb02d8706e257c3c.tar
dexon-sol-tools-d8e35c364ea94b606810b340fb02d8706e257c3c.tar.gz
dexon-sol-tools-d8e35c364ea94b606810b340fb02d8706e257c3c.tar.bz2
dexon-sol-tools-d8e35c364ea94b606810b340fb02d8706e257c3c.tar.lz
dexon-sol-tools-d8e35c364ea94b606810b340fb02d8706e257c3c.tar.xz
dexon-sol-tools-d8e35c364ea94b606810b340fb02d8706e257c3c.tar.zst
dexon-sol-tools-d8e35c364ea94b606810b340fb02d8706e257c3c.zip
Add EXPIRED test
Diffstat (limited to 'test/utils')
-rw-r--r--test/utils/order_factory.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/utils/order_factory.ts b/test/utils/order_factory.ts
index e41e973ee..c6c6ed927 100644
--- a/test/utils/order_factory.ts
+++ b/test/utils/order_factory.ts
@@ -14,10 +14,14 @@ export const orderFactory = {
makerTokenAmount: BigNumber.BigNumber|number,
makerTokenAddress: string,
takerTokenAmount: BigNumber.BigNumber|number,
- takerTokenAddress: string): Promise<SignedOrder> {
+ takerTokenAddress: string,
+ expirationUnixTimestampSec?: BigNumber.BigNumber): Promise<SignedOrder> {
// TODO refactor and check
const exchangeAddress: string = (ExchangeArtifacts as any).networks[networkId].address;
- const INF_TIMESTAMP = 2524604400;
+ const INF_TIMESTAMP = new BigNumber(2524604400);
+ expirationUnixTimestampSec = _.isUndefined(expirationUnixTimestampSec) ?
+ INF_TIMESTAMP :
+ expirationUnixTimestampSec;
const order = {
maker,
taker,
@@ -29,7 +33,7 @@ export const orderFactory = {
takerTokenAddress,
salt: ZeroEx.generatePseudoRandomSalt(),
feeRecipient: constants.NULL_ADDRESS,
- expirationUnixTimestampSec: new BigNumber(INF_TIMESTAMP),
+ expirationUnixTimestampSec,
};
const orderHash = ZeroEx.getOrderHashHex(exchangeAddress, order);
const ecSignature = await zeroEx.signOrderHashAsync(orderHash);