Move field declaration to the begining of the class

This commit is contained in:
Leonid Logvinov 2017-05-29 22:34:06 +02:00
parent 96092de5cb
commit b46ad44856
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4

View File

@ -15,6 +15,14 @@ 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',
};
constructor(web3Wrapper: Web3Wrapper) {
super(web3Wrapper);
}
@ -85,14 +93,6 @@ export class ExchangeWrapper extends ContractWrapper {
}
return response;
}
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 async getExchangeInstanceOrThrowAsync(): Promise<ExchangeContract> {
const contractInstance = await this.instantiateContractIfExistsAsync((ExchangeArtifacts as any));
return contractInstance as ExchangeContract;