aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-01 22:21:09 +0800
committerFabio Berger <me@fabioberger.com>2017-06-01 22:21:09 +0800
commitabd113f61f67b08b9a232a89832b1db4318dac9e (patch)
tree757df0cc0298508a94b4105fde323cf01ef9d0ea /test
parent44f11442424c88d1130ee398d0714636c5ade045 (diff)
parent52bdc0d3432ef917cca15522cea78255d03d82f6 (diff)
downloaddexon-0x-contracts-abd113f61f67b08b9a232a89832b1db4318dac9e.tar.gz
dexon-0x-contracts-abd113f61f67b08b9a232a89832b1db4318dac9e.tar.zst
dexon-0x-contracts-abd113f61f67b08b9a232a89832b1db4318dac9e.zip
Merge branch 'fillOrderAsync' of github.com:0xProject/0x.js into fillOrderAsync
Diffstat (limited to 'test')
-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);