aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts3
-rw-r--r--src/types.ts1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 40f22bd28..ded0d3519 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -125,6 +125,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));
diff --git a/src/types.ts b/src/types.ts
index 216026b3d..7c5e1825d 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -88,6 +88,7 @@ export type ExchangeContractErrs = keyof typeof ExchangeContractErrs;
export const FillOrderValidationErrs = strEnum([
'FILL_AMOUNT_IS_ZERO',
'NOT_A_TAKER',
+ 'EXPIRED',
]);
export type FillOrderValidationErrs = keyof typeof FillOrderValidationErrs;