aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/exchange_wrapper.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-09-18 21:55:26 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-09-18 21:55:26 +0800
commit504e7a25a5ee138941ca35d4aad1b63444e47033 (patch)
treec60208acd76a53cae30050ebd768d9fa0562f88e /src/contract_wrappers/exchange_wrapper.ts
parent8db90538a17a0458fba6d2ed8a8b51bf9edf0fa4 (diff)
downloaddexon-0x-contracts-504e7a25a5ee138941ca35d4aad1b63444e47033.tar
dexon-0x-contracts-504e7a25a5ee138941ca35d4aad1b63444e47033.tar.gz
dexon-0x-contracts-504e7a25a5ee138941ca35d4aad1b63444e47033.tar.bz2
dexon-0x-contracts-504e7a25a5ee138941ca35d4aad1b63444e47033.tar.lz
dexon-0x-contracts-504e7a25a5ee138941ca35d4aad1b63444e47033.tar.xz
dexon-0x-contracts-504e7a25a5ee138941ca35d4aad1b63444e47033.tar.zst
dexon-0x-contracts-504e7a25a5ee138941ca35d4aad1b63444e47033.zip
Make contract addresses configurable
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 17e8095a4..2360f639d 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -56,6 +56,7 @@ export class ExchangeWrapper extends ContractWrapper {
[ExchangeContractErrCodes.ERROR_FILL_TRUNCATION]: ExchangeContractErrs.OrderFillRoundingError,
[ExchangeContractErrCodes.ERROR_FILL_BALANCE_ALLOWANCE]: ExchangeContractErrs.FillBalanceAllowanceError,
};
+ private _contractAddress?: string;
private static _getOrderAddressesAndValues(order: Order): [OrderAddresses, OrderValues] {
const orderAddresses: OrderAddresses = [
order.maker,
@@ -74,11 +75,12 @@ export class ExchangeWrapper extends ContractWrapper {
];
return [orderAddresses, orderValues];
}
- constructor(web3Wrapper: Web3Wrapper, tokenWrapper: TokenWrapper) {
+ constructor(web3Wrapper: Web3Wrapper, tokenWrapper: TokenWrapper, contractAddress?: string) {
super(web3Wrapper);
this._tokenWrapper = tokenWrapper;
this._orderValidationUtils = new OrderValidationUtils(tokenWrapper, this);
this._exchangeLogEventEmitters = [];
+ this._contractAddress = contractAddress;
}
/**
* Returns the unavailable takerAmount of an order. Unavailable amount is defined as the total
@@ -738,7 +740,7 @@ export class ExchangeWrapper extends ContractWrapper {
return this._exchangeContractIfExists;
}
const contractInstance = await this._instantiateContractIfExistsAsync<ExchangeContract>(
- artifacts.ExchangeArtifact,
+ artifacts.ExchangeArtifact, this._contractAddress,
);
this._exchangeContractIfExists = contractInstance as ExchangeContract;
return this._exchangeContractIfExists;