diff options
author | Fabio Berger <me@fabioberger.com> | 2017-11-28 12:23:51 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-11-28 12:23:51 +0800 |
commit | 78f0ab36823127b67c1ea24b7245c51ba814b16a (patch) | |
tree | efbfbdeec168799da8c3ed8000ee6f1c96a741ca /packages/website/ts | |
parent | 5a59ac4c6b9068fa55168bb072ee782cf3c7cd91 (diff) | |
download | dexon-sol-tools-78f0ab36823127b67c1ea24b7245c51ba814b16a.tar dexon-sol-tools-78f0ab36823127b67c1ea24b7245c51ba814b16a.tar.gz dexon-sol-tools-78f0ab36823127b67c1ea24b7245c51ba814b16a.tar.bz2 dexon-sol-tools-78f0ab36823127b67c1ea24b7245c51ba814b16a.tar.lz dexon-sol-tools-78f0ab36823127b67c1ea24b7245c51ba814b16a.tar.xz dexon-sol-tools-78f0ab36823127b67c1ea24b7245c51ba814b16a.tar.zst dexon-sol-tools-78f0ab36823127b67c1ea24b7245c51ba814b16a.zip |
Last remaining website fixes
Diffstat (limited to 'packages/website/ts')
-rw-r--r-- | packages/website/ts/blockchain.ts | 16 | ||||
-rw-r--r-- | packages/website/ts/subproviders/redundant_rpc_subprovider.ts | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index fbe12ee75..38a2ef532 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -217,7 +217,7 @@ export class Blockchain { this.web3Wrapper.destroy(); const shouldPollUserAddress = false; this.web3Wrapper = new Web3Wrapper(this.dispatcher, provider, this.networkId, shouldPollUserAddress); - await this.zeroEx.setProviderAsync(provider); + this.zeroEx.setProvider(provider, networkId); await this.postInstantiationOrUpdatingProviderZeroExAsync(); break; } @@ -229,7 +229,7 @@ export class Blockchain { provider = this.cachedProvider; const shouldPollUserAddress = true; this.web3Wrapper = new Web3Wrapper(this.dispatcher, provider, this.networkId, shouldPollUserAddress); - await this.zeroEx.setProviderAsync(provider); + this.zeroEx.setProvider(provider, this.networkId); await this.postInstantiationOrUpdatingProviderZeroExAsync(); delete this.ledgerSubProvider; delete this.cachedProvider; @@ -612,7 +612,7 @@ export class Blockchain { return tokenByAddress; } private async onPageLoadInitFireAndForgetAsync() { - await this.onPageLoadAsync(); // wait for page to load + await Blockchain.onPageLoadAsync(); // wait for page to load // Hack: We need to know the networkId the injectedWeb3 is connected to (if it is defined) in // order to properly instantiate the web3Wrapper. Since we must use the async call, we cannot @@ -630,8 +630,10 @@ export class Blockchain { } } - const provider = await this.getProviderAsync(injectedWeb3, networkId); - this.zeroEx = new ZeroEx(provider); + const provider = await Blockchain.getProviderAsync(injectedWeb3, networkId); + this.zeroEx = new ZeroEx(provider, { + networkId, + }); this.updateProviderName(injectedWeb3); const shouldPollUserAddress = true; this.web3Wrapper = new Web3Wrapper(this.dispatcher, provider, networkId, shouldPollUserAddress); @@ -641,12 +643,12 @@ export class Blockchain { // of the ZeroEx instance. private async postInstantiationOrUpdatingProviderZeroExAsync() { utils.assert(!_.isUndefined(this.zeroEx), 'ZeroEx must be instantiated.'); - this.exchangeAddress = await this.zeroEx.exchange.getContractAddressAsync(); + this.exchangeAddress = await this.zeroEx.exchange.getContractAddress(); } private updateProviderName(injectedWeb3: Web3) { const doesInjectedWeb3Exist = !_.isUndefined(injectedWeb3); const providerName = doesInjectedWeb3Exist ? - this.getNameGivenProvider(injectedWeb3.currentProvider) : + Blockchain.getNameGivenProvider(injectedWeb3.currentProvider) : constants.PUBLIC_PROVIDER_NAME; this.dispatcher.updateInjectedProviderName(providerName); } diff --git a/packages/website/ts/subproviders/redundant_rpc_subprovider.ts b/packages/website/ts/subproviders/redundant_rpc_subprovider.ts index 74675d910..8dffd4437 100644 --- a/packages/website/ts/subproviders/redundant_rpc_subprovider.ts +++ b/packages/website/ts/subproviders/redundant_rpc_subprovider.ts @@ -33,7 +33,7 @@ export class RedundantRPCSubprovider extends Subprovider { end: (err?: Error, data?: any) => void): Promise<void> { const rpcsCopy = this.rpcs.slice(); try { - const data = await this.firstSuccessAsync(rpcsCopy, payload, next); + const data = await RedundantRPCSubprovider.firstSuccessAsync(rpcsCopy, payload, next); end(null, data); } catch (err) { end(err); |