diff options
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 18 | ||||
-rw-r--r-- | src/types.ts | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index 88b0fa913..bf3f10e28 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -3,7 +3,7 @@ import {Web3Wrapper} from '../web3_wrapper'; import { ECSignature, ExchangeContract, - ExchangeContractErrs, + ExchangeContractErrCodes, FillOrderValidationErrs, OrderValues, OrderAddresses, @@ -20,13 +20,13 @@ import {ContractResponse} from '../types'; import {constants} from '../utils/constants'; export class ExchangeWrapper extends ContractWrapper { - private exchangeContractErrToMsg = { - [ExchangeContractErrs.ERROR_FILL_EXPIRED]: 'The order you attempted to fill is expired', - [ExchangeContractErrs.ERROR_CANCEL_EXPIRED]: 'The order you attempted to cancel is expired', - [ExchangeContractErrs.ERROR_FILL_NO_VALUE]: 'This order has already been filled or cancelled', - [ExchangeContractErrs.ERROR_CANCEL_NO_VALUE]: 'This order has already been filled or cancelled', - [ExchangeContractErrs.ERROR_FILL_TRUNCATION]: 'The rounding error was too large when filling this order', - [ExchangeContractErrs.ERROR_FILL_BALANCE_ALLOWANCE]: 'Maker or taker has insufficient balance or allowance', + private exchangeContractErrCodesToMsg = { + [ExchangeContractErrCodes.ERROR_FILL_EXPIRED]: 'The order you attempted to fill is expired', + [ExchangeContractErrCodes.ERROR_CANCEL_EXPIRED]: 'The order you attempted to cancel is expired', + [ExchangeContractErrCodes.ERROR_FILL_NO_VALUE]: 'This order has already been filled or cancelled', + [ExchangeContractErrCodes.ERROR_CANCEL_NO_VALUE]: 'This order has already been filled or cancelled', + [ExchangeContractErrCodes.ERROR_FILL_TRUNCATION]: 'The rounding error was too large when filling this order', + [ExchangeContractErrCodes.ERROR_FILL_BALANCE_ALLOWANCE]: 'Maker or taker has insufficient balance or allowance', }; private exchangeContractIfExists?: ExchangeContract; constructor(web3Wrapper: Web3Wrapper) { @@ -131,7 +131,7 @@ export class ExchangeWrapper extends ContractWrapper { const errEvent = _.find(logs, {event: 'LogError'}); if (!_.isUndefined(errEvent)) { const errCode = errEvent.args.errorId.toNumber(); - const humanReadableErrMessage = this.exchangeContractErrToMsg[errCode]; + const humanReadableErrMessage = this.exchangeContractErrCodesToMsg[errCode]; throw new Error(humanReadableErrMessage); } } diff --git a/src/types.ts b/src/types.ts index 6d4166013..992bb4b00 100644 --- a/src/types.ts +++ b/src/types.ts @@ -70,7 +70,7 @@ export const SolidityTypes = strEnum([ ]); export type SolidityTypes = keyof typeof SolidityTypes; -export enum ExchangeContractErrs { +export enum ExchangeContractErrCodes { ERROR_FILL_EXPIRED, // Order has already expired ERROR_FILL_NO_VALUE, // Order has already been fully filled or cancelled ERROR_FILL_TRUNCATION, // Rounding error too large |