diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-06-28 01:40:07 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-06-28 01:40:07 +0800 |
commit | 2a092143dc01d84e5dc0b6dc2998cfd4efb38d73 (patch) | |
tree | 2692a23094cc073771892e34cd1e994eeedeaaa0 /packages/website/ts/blockchain.ts | |
parent | de50407953d36ae43f909ad8b3b5e249151bdb51 (diff) | |
download | dexon-sol-tools-2a092143dc01d84e5dc0b6dc2998cfd4efb38d73.tar dexon-sol-tools-2a092143dc01d84e5dc0b6dc2998cfd4efb38d73.tar.gz dexon-sol-tools-2a092143dc01d84e5dc0b6dc2998cfd4efb38d73.tar.bz2 dexon-sol-tools-2a092143dc01d84e5dc0b6dc2998cfd4efb38d73.tar.lz dexon-sol-tools-2a092143dc01d84e5dc0b6dc2998cfd4efb38d73.tar.xz dexon-sol-tools-2a092143dc01d84e5dc0b6dc2998cfd4efb38d73.tar.zst dexon-sol-tools-2a092143dc01d84e5dc0b6dc2998cfd4efb38d73.zip |
Remove IS_MAINNET_ENABLED config
Diffstat (limited to 'packages/website/ts/blockchain.ts')
-rw-r--r-- | packages/website/ts/blockchain.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index cac362795..a0a404d5a 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -97,9 +97,6 @@ export class Blockchain { private static _getInjectedWeb3(): any { return (window as any).web3; } - private static _getFallbackNetworkId(): number { - return configs.IS_MAINNET_ENABLED ? constants.NETWORK_ID_MAINNET : constants.NETWORK_ID_KOVAN; - } private static async _getInjectedWeb3ProviderNetworkIdIfExistsAsync(): Promise<number> { // 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 @@ -172,7 +169,7 @@ export class Blockchain { // injected into their browser. const provider = new ProviderEngine(); provider.addProvider(new FilterSubprovider()); - const networkId = Blockchain._getFallbackNetworkId(); + const networkId = constants.NETWORK_ID_MAINNET; const rpcSubproviders = _.map(configs.PUBLIC_NODE_URLS_BY_NETWORK_ID[networkId], publicNodeUrl => { return new RpcSubprovider({ rpcUrl: publicNodeUrl, @@ -774,7 +771,7 @@ export class Blockchain { private async _onPageLoadInitFireAndForgetAsync(): Promise<void> { await utils.onPageLoadAsync(); // wait for page to load const networkIdIfExists = await Blockchain._getInjectedWeb3ProviderNetworkIdIfExistsAsync(); - this.networkId = !_.isUndefined(networkIdIfExists) ? networkIdIfExists : Blockchain._getFallbackNetworkId(); + this.networkId = !_.isUndefined(networkIdIfExists) ? networkIdIfExists : constants.NETWORK_ID_MAINNET; const injectedWeb3 = Blockchain._getInjectedWeb3(); if (injectedWeb3) { const injectedProviderObservable = injectedWeb3.currentProvider.publicConfigStore; |