aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/exchange_wrapper.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-01 21:51:45 +0800
committerFabio Berger <me@fabioberger.com>2017-06-01 21:51:45 +0800
commit6a57c42e253a52a449cae8a5c6565276cb01a86c (patch)
treec36dd70d94318313e138ef089576fee6f890768e /src/contract_wrappers/exchange_wrapper.ts
parent88316455b74d2ecde1da55bf2bb36b6c9b46bcb1 (diff)
downloaddexon-sol-tools-6a57c42e253a52a449cae8a5c6565276cb01a86c.tar
dexon-sol-tools-6a57c42e253a52a449cae8a5c6565276cb01a86c.tar.gz
dexon-sol-tools-6a57c42e253a52a449cae8a5c6565276cb01a86c.tar.bz2
dexon-sol-tools-6a57c42e253a52a449cae8a5c6565276cb01a86c.tar.lz
dexon-sol-tools-6a57c42e253a52a449cae8a5c6565276cb01a86c.tar.xz
dexon-sol-tools-6a57c42e253a52a449cae8a5c6565276cb01a86c.tar.zst
dexon-sol-tools-6a57c42e253a52a449cae8a5c6565276cb01a86c.zip
Rename ExchangeContractErrs to ExchangeContractErrCodes
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index d1763e307..1311730a0 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,
OrderValues,
OrderAddresses,
SignedOrder,
@@ -19,13 +19,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) {
@@ -116,7 +116,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);
}
}