diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-02 23:39:21 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-02 23:39:21 +0800 |
commit | f5158eebf335c9fbcfb7cfb6f32a0ecd1161391d (patch) | |
tree | 9b42a6f5fdbff4d2e2f043b6e404c9225fc3ae10 /src/contract_wrappers/exchange_wrapper.ts | |
parent | e5cc0e0562eccf67eff9cf0521c4884ffc3b0f3b (diff) | |
download | dexon-0x-contracts-f5158eebf335c9fbcfb7cfb6f32a0ecd1161391d.tar dexon-0x-contracts-f5158eebf335c9fbcfb7cfb6f32a0ecd1161391d.tar.gz dexon-0x-contracts-f5158eebf335c9fbcfb7cfb6f32a0ecd1161391d.tar.bz2 dexon-0x-contracts-f5158eebf335c9fbcfb7cfb6f32a0ecd1161391d.tar.lz dexon-0x-contracts-f5158eebf335c9fbcfb7cfb6f32a0ecd1161391d.tar.xz dexon-0x-contracts-f5158eebf335c9fbcfb7cfb6f32a0ecd1161391d.tar.zst dexon-0x-contracts-f5158eebf335c9fbcfb7cfb6f32a0ecd1161391d.zip |
Assign timestamp to a variable
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index ac15faff4..4c46404bb 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -131,7 +131,8 @@ export class ExchangeWrapper extends ContractWrapper { if (signedOrder.taker !== constants.NULL_ADDRESS && signedOrder.taker !== senderAddress) { throw new Error(FillOrderValidationErrs.TRANSACTION_SENDER_IS_NOT_FILL_ORDER_TAKER); } - if (signedOrder.expirationUnixTimestampSec.lessThan(Date.now() / 1000)) { + const currentUnixTimestampSec = Date.now() / 1000; + if (signedOrder.expirationUnixTimestampSec.lessThan(currentUnixTimestampSec)) { throw new Error(FillOrderValidationErrs.EXPIRED); } const zrxTokenAddress = await this.getZRXTokenAddressAsync(); |