diff options
author | Thomas Huang <tmashuang@users.noreply.github.com> | 2018-11-04 03:28:59 +0800 |
---|---|---|
committer | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2018-11-04 05:21:41 +0800 |
commit | ed4f612bdc490435b88feb26b2a9df8c9320d3bb (patch) | |
tree | 158134467289bc12d3647ea4170ac9b3faa76832 /app/scripts | |
parent | 65b3d6b98722b29f2a944912fb50bce97cf6b7d7 (diff) | |
download | tangerine-wallet-browser-ed4f612bdc490435b88feb26b2a9df8c9320d3bb.tar tangerine-wallet-browser-ed4f612bdc490435b88feb26b2a9df8c9320d3bb.tar.gz tangerine-wallet-browser-ed4f612bdc490435b88feb26b2a9df8c9320d3bb.tar.bz2 tangerine-wallet-browser-ed4f612bdc490435b88feb26b2a9df8c9320d3bb.tar.lz tangerine-wallet-browser-ed4f612bdc490435b88feb26b2a9df8c9320d3bb.tar.xz tangerine-wallet-browser-ed4f612bdc490435b88feb26b2a9df8c9320d3bb.tar.zst tangerine-wallet-browser-ed4f612bdc490435b88feb26b2a9df8c9320d3bb.zip |
Revert "support eth_chainId"
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/controllers/network/network.js | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/app/scripts/controllers/network/network.js b/app/scripts/controllers/network/network.js index c21e9c764..b459b8013 100644 --- a/app/scripts/controllers/network/network.js +++ b/app/scripts/controllers/network/network.js @@ -107,20 +107,10 @@ module.exports = class NetworkController extends EventEmitter { } var { type } = this.providerStore.getState() const ethQuery = new EthQuery(this._provider) - // first attempt to perform lookup via eth_chainId - ethQuery.sendAsync({ method: 'eth_chainId' }, (err, chainIdHex) => { - if (err) { - // if eth_chainId is not supported, fallback to net_verion - ethQuery.sendAsync({ method: 'net_version' }, (err, network) => { - if (err) return this.setNetworkState('loading') - log.info(`net_version returned ${network}`) - this.setNetworkState(network, type) - }) - return - } - const chainId = Number.parseInt(chainIdHex, 16) - log.info(`net_version returned ${chainId}`) - this.setNetworkState(chainId, type) + ethQuery.sendAsync({ method: 'net_version' }, (err, network) => { + if (err) return this.setNetworkState('loading') + log.info('web3.getNetwork returned ' + network) + this.setNetworkState(network, type) }) } |