aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-09 22:08:22 +0800
committerFabio Berger <me@fabioberger.com>2018-03-09 22:08:22 +0800
commit342a697e42a7209d9454fcd38321e64c7fca3fd0 (patch)
tree4ef682149c6bf64ec32d474ac6201e2605ccaf32
parent918f3cde948592e9cb83342c051b71378821f3c5 (diff)
downloaddexon-sol-tools-342a697e42a7209d9454fcd38321e64c7fca3fd0.tar
dexon-sol-tools-342a697e42a7209d9454fcd38321e64c7fca3fd0.tar.gz
dexon-sol-tools-342a697e42a7209d9454fcd38321e64c7fca3fd0.tar.bz2
dexon-sol-tools-342a697e42a7209d9454fcd38321e64c7fca3fd0.tar.lz
dexon-sol-tools-342a697e42a7209d9454fcd38321e64c7fca3fd0.tar.xz
dexon-sol-tools-342a697e42a7209d9454fcd38321e64c7fca3fd0.tar.zst
dexon-sol-tools-342a697e42a7209d9454fcd38321e64c7fca3fd0.zip
Remove _exchangeAddress instance var from blockchain class
-rw-r--r--packages/website/ts/blockchain.ts11
1 files changed, 1 insertions, 10 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts
index fca9504d7..db8a56899 100644
--- a/packages/website/ts/blockchain.ts
+++ b/packages/website/ts/blockchain.ts
@@ -213,7 +213,6 @@ export class Blockchain {
const shouldPollUserAddress = false;
this._web3Wrapper = new Web3Wrapper(this._dispatcher, provider, this.networkId, shouldPollUserAddress);
this._zeroEx.setProvider(provider, this.networkId);
- await this._postInstantiationOrUpdatingProviderZeroExAsync();
this._web3Wrapper.startEmittingNetworkConnectionAndUserBalanceState();
this._dispatcher.updateProviderType(ProviderType.Ledger);
}
@@ -235,7 +234,6 @@ export class Blockchain {
this._userAddress = await this._web3Wrapper.getFirstAccountIfExistsAsync();
this._zeroEx.setProvider(provider, this.networkId);
- await this._postInstantiationOrUpdatingProviderZeroExAsync();
await this.fetchTokenInformationAsync();
this._web3Wrapper.startEmittingNetworkConnectionAndUserBalanceState();
@@ -347,7 +345,7 @@ export class Blockchain {
return unavailableTakerAmount;
}
public getExchangeContractAddressIfExists() {
- return this._exchangeAddress;
+ return this._zeroEx.exchange.getContractAddress();
}
public async validateFillOrderThrowIfInvalidAsync(
signedOrder: SignedOrder,
@@ -740,19 +738,12 @@ export class Blockchain {
this._updateProviderName(injectedWeb3);
const shouldPollUserAddress = true;
this._web3Wrapper = new Web3Wrapper(this._dispatcher, provider, this.networkId, shouldPollUserAddress);
- await this._postInstantiationOrUpdatingProviderZeroExAsync();
this._userAddress = await this._web3Wrapper.getFirstAccountIfExistsAsync();
this._dispatcher.updateUserAddress(this._userAddress);
await this.fetchTokenInformationAsync();
this._web3Wrapper.startEmittingNetworkConnectionAndUserBalanceState();
await this._rehydrateStoreWithContractEvents();
}
- // This method should always be run after instantiating or updating the provider
- // of the ZeroEx instance.
- private async _postInstantiationOrUpdatingProviderZeroExAsync() {
- utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.');
- this._exchangeAddress = this._zeroEx.exchange.getContractAddress();
- }
private _updateProviderName(injectedWeb3: Web3) {
const doesInjectedWeb3Exist = !_.isUndefined(injectedWeb3);
const providerName = doesInjectedWeb3Exist