aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-02 22:54:21 +0800
committerFabio Berger <me@fabioberger.com>2017-06-02 22:54:21 +0800
commitade42047436f8f81bcc158fdfdc297dc6a2b1f66 (patch)
tree13eafbe68c700d710d434f6f67a74927e645230b /src
parent00fde26a541797902e1732b0a978376c8960195e (diff)
downloaddexon-sol-tools-ade42047436f8f81bcc158fdfdc297dc6a2b1f66.tar
dexon-sol-tools-ade42047436f8f81bcc158fdfdc297dc6a2b1f66.tar.gz
dexon-sol-tools-ade42047436f8f81bcc158fdfdc297dc6a2b1f66.tar.bz2
dexon-sol-tools-ade42047436f8f81bcc158fdfdc297dc6a2b1f66.tar.lz
dexon-sol-tools-ade42047436f8f81bcc158fdfdc297dc6a2b1f66.tar.xz
dexon-sol-tools-ade42047436f8f81bcc158fdfdc297dc6a2b1f66.tar.zst
dexon-sol-tools-ade42047436f8f81bcc158fdfdc297dc6a2b1f66.zip
Improve error names and remove duplicate import
Diffstat (limited to 'src')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts10
-rw-r--r--src/types.ts6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index fa5c16485..93e49cf33 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -10,6 +10,7 @@ import {
OrderAddresses,
SignedOrder,
ContractEvent,
+ ContractResponse,
} from '../types';
import {assert} from '../utils/assert';
import {ContractWrapper} from './contract_wrapper';
@@ -17,18 +18,17 @@ import * as ExchangeArtifacts from '../artifacts/Exchange.json';
import {ecSignatureSchema} from '../schemas/ec_signature_schema';
import {signedOrderSchema} from '../schemas/order_schemas';
import {SchemaValidator} from '../utils/schema_validator';
-import {ContractResponse} from '../types';
import {constants} from '../utils/constants';
import {TokenWrapper} from './token_wrapper';
export class ExchangeWrapper extends ContractWrapper {
private exchangeContractErrCodesToMsg = {
- [ExchangeContractErrCodes.ERROR_FILL_EXPIRED]: ExchangeContractErrs.ORDER_EXPIRED,
- [ExchangeContractErrCodes.ERROR_CANCEL_EXPIRED]: ExchangeContractErrs.ORDER_EXPIRED,
+ [ExchangeContractErrCodes.ERROR_FILL_EXPIRED]: ExchangeContractErrs.ORDER_FILL_EXPIRED,
+ [ExchangeContractErrCodes.ERROR_CANCEL_EXPIRED]: ExchangeContractErrs.ORDER_FILL_EXPIRED,
[ExchangeContractErrCodes.ERROR_FILL_NO_VALUE]: ExchangeContractErrs.ORDER_REMAINING_FILL_AMOUNT_ZERO,
[ExchangeContractErrCodes.ERROR_CANCEL_NO_VALUE]: ExchangeContractErrs.ORDER_REMAINING_FILL_AMOUNT_ZERO,
- [ExchangeContractErrCodes.ERROR_FILL_TRUNCATION]: ExchangeContractErrs.ORDER_ROUNDING_ERROR,
- [ExchangeContractErrCodes.ERROR_FILL_BALANCE_ALLOWANCE]: ExchangeContractErrs.ORDER_BALANCE_ALLOWANCE_ERROR,
+ [ExchangeContractErrCodes.ERROR_FILL_TRUNCATION]: ExchangeContractErrs.ORDER_FILL_ROUNDING_ERROR,
+ [ExchangeContractErrCodes.ERROR_FILL_BALANCE_ALLOWANCE]: ExchangeContractErrs.FILL_BALANCE_ALLOWANCE_ERROR,
};
private exchangeContractIfExists?: ExchangeContract;
private tokenWrapper: TokenWrapper;
diff --git a/src/types.ts b/src/types.ts
index 4819b13ac..b39484f8a 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -85,10 +85,10 @@ export enum ExchangeContractErrCodes {
}
export const ExchangeContractErrs = strEnum([
- 'ORDER_EXPIRED',
+ 'ORDER_FILL_EXPIRED',
'ORDER_REMAINING_FILL_AMOUNT_ZERO',
- 'ORDER_ROUNDING_ERROR',
- 'ORDER_BALANCE_ALLOWANCE_ERROR',
+ 'ORDER_FILL_ROUNDING_ERROR',
+ 'FILL_BALANCE_ALLOWANCE_ERROR',
]);
export type ExchangeContractErrs = keyof typeof ExchangeContractErrs;