From 52bdc0d3432ef917cca15522cea78255d03d82f6 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 1 Jun 2017 16:17:15 +0200 Subject: Add timestamp parameter to order factory --- test/utils/order_factory.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test') 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 { + takerTokenAddress: string, + expirationUnixTimestampSec?: BigNumber.BigNumber): Promise { // 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); -- cgit v1.2.3