diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-01 22:15:58 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-01 22:15:58 +0800 |
commit | 78259dc2af07a7c56b89669cd0b6a1c7b997092b (patch) | |
tree | 98cf613c092aae34bddfdd357484ed77a9041993 /src | |
parent | 7d64ce1220c21c6a4c9f06df39132aceb72c4461 (diff) | |
download | dexon-sol-tools-78259dc2af07a7c56b89669cd0b6a1c7b997092b.tar dexon-sol-tools-78259dc2af07a7c56b89669cd0b6a1c7b997092b.tar.gz dexon-sol-tools-78259dc2af07a7c56b89669cd0b6a1c7b997092b.tar.bz2 dexon-sol-tools-78259dc2af07a7c56b89669cd0b6a1c7b997092b.tar.lz dexon-sol-tools-78259dc2af07a7c56b89669cd0b6a1c7b997092b.tar.xz dexon-sol-tools-78259dc2af07a7c56b89669cd0b6a1c7b997092b.tar.zst dexon-sol-tools-78259dc2af07a7c56b89669cd0b6a1c7b997092b.zip |
Add expired check
Diffstat (limited to 'src')
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index dbb427d2c..1232b969b 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -120,6 +120,9 @@ export class ExchangeWrapper extends ContractWrapper { if (signedOrder.taker !== constants.NULL_ADDRESS && signedOrder.taker !== senderAddress) { throw new Error(FillOrderValidationErrs.NOT_A_TAKER); } + if (signedOrder.expirationUnixTimestampSec.lessThan(Date.now() / 1000)) { + throw new Error(FillOrderValidationErrs.EXPIRED); + } } private async getExchangeInstanceOrThrowAsync(): Promise<ExchangeContract> { const contractInstance = await this.instantiateContractIfExistsAsync((ExchangeArtifacts as any)); |