mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Revert "support eth_chainId"
This commit is contained in:
parent
65b3d6b987
commit
ed4f612bdc
@ -107,20 +107,10 @@ module.exports = class NetworkController extends EventEmitter {
|
|||||||
}
|
}
|
||||||
var { type } = this.providerStore.getState()
|
var { type } = this.providerStore.getState()
|
||||||
const ethQuery = new EthQuery(this._provider)
|
const ethQuery = new EthQuery(this._provider)
|
||||||
// first attempt to perform lookup via eth_chainId
|
ethQuery.sendAsync({ method: 'net_version' }, (err, network) => {
|
||||||
ethQuery.sendAsync({ method: 'eth_chainId' }, (err, chainIdHex) => {
|
if (err) return this.setNetworkState('loading')
|
||||||
if (err) {
|
log.info('web3.getNetwork returned ' + network)
|
||||||
// if eth_chainId is not supported, fallback to net_verion
|
this.setNetworkState(network, type)
|
||||||
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)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user