Rename EXPIRED to FILL_ORDER_EXPIRED

This commit is contained in:
Leonid Logvinov
2017-06-02 17:40:06 +02:00
parent f5158eebf3
commit 7fd84e29ab
3 changed files with 3 additions and 3 deletions

View File

@@ -133,7 +133,7 @@ export class ExchangeWrapper extends ContractWrapper {
}
const currentUnixTimestampSec = Date.now() / 1000;
if (signedOrder.expirationUnixTimestampSec.lessThan(currentUnixTimestampSec)) {
throw new Error(FillOrderValidationErrs.EXPIRED);
throw new Error(FillOrderValidationErrs.FILL_ORDER_EXPIRED);
}
const zrxTokenAddress = await this.getZRXTokenAddressAsync();
await this.validateFillOrderBalancesAndAllowancesAndThrowIfInvalidAsync(signedOrder, fillTakerAmount,

View File

@@ -95,7 +95,7 @@ export type ExchangeContractErrs = keyof typeof ExchangeContractErrs;
export const FillOrderValidationErrs = strEnum([
'FILL_AMOUNT_IS_ZERO',
'TRANSACTION_SENDER_IS_NOT_FILL_ORDER_TAKER',
'EXPIRED',
'FILL_ORDER_EXPIRED',
'NOT_ENOUGH_TAKER_BALANCE',
'NOT_ENOUGH_TAKER_ALLOWANCE',
'NOT_ENOUGH_MAKER_BALANCE',

View File

@@ -158,7 +158,7 @@ describe('ExchangeWrapper', () => {
zeroEx.setTransactionSenderAccount(takerAddress);
return expect(zeroEx.exchange.fillOrderAsync(
signedOrder, fillTakerAmount, shouldCheckTransfer,
)).to.be.rejectedWith(FillOrderValidationErrs.EXPIRED);
)).to.be.rejectedWith(FillOrderValidationErrs.FILL_ORDER_EXPIRED);
});
describe('should throw when not enough balance or allowance to fulfill the order', () => {
const fillableAmount = new BigNumber(5);