mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix network checking
This commit is contained in:
parent
e3fb7fa7bb
commit
fc26a0a899
@ -38,7 +38,7 @@ module.exports = class KeyringController extends EventEmitter {
|
|||||||
this._unconfTxCbs = {}
|
this._unconfTxCbs = {}
|
||||||
this._unconfMsgCbs = {}
|
this._unconfMsgCbs = {}
|
||||||
|
|
||||||
this.network = null
|
this.network = opts.network
|
||||||
|
|
||||||
// TEMPORARY UNTIL FULL DEPRECATION:
|
// TEMPORARY UNTIL FULL DEPRECATION:
|
||||||
this.idStoreMigrator = new IdStoreMigrator({
|
this.idStoreMigrator = new IdStoreMigrator({
|
||||||
@ -69,7 +69,6 @@ module.exports = class KeyringController extends EventEmitter {
|
|||||||
conversionDate: this.configManager.getConversionDate(),
|
conversionDate: this.configManager.getConversionDate(),
|
||||||
keyringTypes: this.keyringTypes.map((krt) => krt.type()),
|
keyringTypes: this.keyringTypes.map((krt) => krt.type()),
|
||||||
identities: this.identities,
|
identities: this.identities,
|
||||||
network: this.network,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -534,25 +533,6 @@ module.exports = class KeyringController extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getNetwork(err) {
|
|
||||||
if (err) {
|
|
||||||
this.network = 'loading'
|
|
||||||
this.emit('update')
|
|
||||||
}
|
|
||||||
|
|
||||||
this.web3.version.getNetwork((err, network) => {
|
|
||||||
if (err) {
|
|
||||||
this.network = 'loading'
|
|
||||||
return this.emit('update')
|
|
||||||
}
|
|
||||||
if (global.METAMASK_DEBUG) {
|
|
||||||
console.log('web3.getNetwork returned ' + network)
|
|
||||||
}
|
|
||||||
this.network = network
|
|
||||||
this.emit('update')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
addGasBuffer(gasHex) {
|
addGasBuffer(gasHex) {
|
||||||
var gas = new BN(gasHex, 16)
|
var gas = new BN(gasHex, 16)
|
||||||
var buffer = new BN('100000', 10)
|
var buffer = new BN('100000', 10)
|
||||||
|
Loading…
Reference in New Issue
Block a user