diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-27 05:17:20 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-27 05:17:20 +0800 |
commit | d66ca7b5cbb5dc90e888c0466326825341d5fda4 (patch) | |
tree | aff8bdf5d5ae5f4e2d7dbe5aa832793337d0fe3e /packages/order-utils/src/order_validation_utils.ts | |
parent | 2a82807be4099460173ce885867896a8755091b2 (diff) | |
download | dexon-sol-tools-d66ca7b5cbb5dc90e888c0466326825341d5fda4.tar dexon-sol-tools-d66ca7b5cbb5dc90e888c0466326825341d5fda4.tar.gz dexon-sol-tools-d66ca7b5cbb5dc90e888c0466326825341d5fda4.tar.bz2 dexon-sol-tools-d66ca7b5cbb5dc90e888c0466326825341d5fda4.tar.lz dexon-sol-tools-d66ca7b5cbb5dc90e888c0466326825341d5fda4.tar.xz dexon-sol-tools-d66ca7b5cbb5dc90e888c0466326825341d5fda4.tar.zst dexon-sol-tools-d66ca7b5cbb5dc90e888c0466326825341d5fda4.zip |
Fix enum name
Diffstat (limited to 'packages/order-utils/src/order_validation_utils.ts')
-rw-r--r-- | packages/order-utils/src/order_validation_utils.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts index fb5143d03..54428f77d 100644 --- a/packages/order-utils/src/order_validation_utils.ts +++ b/packages/order-utils/src/order_validation_utils.ts @@ -1,4 +1,4 @@ -import { RevertReasons, SignedOrder } from '@0xproject/types'; +import { RevertReason, SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Provider } from 'ethereum-types'; import * as _ from 'lodash'; @@ -87,7 +87,7 @@ export class OrderValidationUtils { TransferType.Fee, ); } catch (err) { - throw new Error(RevertReasons.TransferFailed); + throw new Error(RevertReason.TransferFailed); } } private static _validateRemainingFillAmountNotZeroOrThrow( @@ -95,13 +95,13 @@ export class OrderValidationUtils { filledTakerTokenAmount: BigNumber, ): void { if (takerAssetAmount.eq(filledTakerTokenAmount)) { - throw new Error(RevertReasons.OrderUnfillable); + throw new Error(RevertReason.OrderUnfillable); } } private static _validateOrderNotExpiredOrThrow(expirationTimeSeconds: BigNumber): void { const currentUnixTimestampSec = utils.getCurrentUnixTimestampSec(); if (expirationTimeSeconds.lessThan(currentUnixTimestampSec)) { - throw new Error(RevertReasons.OrderUnfillable); + throw new Error(RevertReason.OrderUnfillable); } } constructor(orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher) { @@ -141,10 +141,10 @@ export class OrderValidationUtils { zrxAssetData: string, ): Promise<BigNumber> { if (fillTakerAssetAmount.eq(0)) { - throw new Error(RevertReasons.InvalidTakerAmount); + throw new Error(RevertReason.InvalidTakerAmount); } if (signedOrder.makerAssetAmount.eq(0) || signedOrder.takerAssetAmount.eq(0)) { - throw new Error(RevertReasons.OrderUnfillable); + throw new Error(RevertReason.OrderUnfillable); } const orderHash = orderHashUtils.getOrderHashHex(signedOrder); const isValid = await isValidSignatureAsync( @@ -162,7 +162,7 @@ export class OrderValidationUtils { filledTakerTokenAmount, ); if (signedOrder.takerAddress !== constants.NULL_ADDRESS && signedOrder.takerAddress !== takerAddress) { - throw new Error(RevertReasons.InvalidTaker); + throw new Error(RevertReason.InvalidTaker); } OrderValidationUtils._validateOrderNotExpiredOrThrow(signedOrder.expirationTimeSeconds); const remainingTakerTokenAmount = signedOrder.takerAssetAmount.minus(filledTakerTokenAmount); @@ -183,7 +183,7 @@ export class OrderValidationUtils { signedOrder.makerAssetAmount, ); if (wouldRoundingErrorOccur) { - throw new Error(RevertReasons.RoundingError); + throw new Error(RevertReason.RoundingError); } return filledTakerTokenAmount; } @@ -204,7 +204,7 @@ export class OrderValidationUtils { zrxAssetData, ); if (filledTakerTokenAmount !== fillTakerAssetAmount) { - throw new Error(RevertReasons.OrderUnfillable); + throw new Error(RevertReason.OrderUnfillable); } } } |