mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #4523 from MetaMask/i4462-FixResetBug
Fix bug where reset account would not work.
This commit is contained in:
commit
c0d2dab28b
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## Current Master
|
## Current Master
|
||||||
|
|
||||||
|
- Fix bug where account reset did not work with custom RPC providers.
|
||||||
|
|
||||||
## 4.7.4 Tue Jun 05 2018
|
## 4.7.4 Tue Jun 05 2018
|
||||||
|
|
||||||
- Add diagnostic reporting for users with multiple HD keyrings
|
- Add diagnostic reporting for users with multiple HD keyrings
|
||||||
|
@ -89,14 +89,21 @@ module.exports = class NetworkController extends EventEmitter {
|
|||||||
type: 'rpc',
|
type: 'rpc',
|
||||||
rpcTarget,
|
rpcTarget,
|
||||||
}
|
}
|
||||||
this.providerStore.updateState(providerConfig)
|
this.providerConfig = providerConfig
|
||||||
this._switchNetwork(providerConfig)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async setProviderType (type) {
|
async setProviderType (type) {
|
||||||
assert.notEqual(type, 'rpc', `NetworkController - cannot call "setProviderType" with type 'rpc'. use "setRpcTarget"`)
|
assert.notEqual(type, 'rpc', `NetworkController - cannot call "setProviderType" with type 'rpc'. use "setRpcTarget"`)
|
||||||
assert(INFURA_PROVIDER_TYPES.includes(type) || type === LOCALHOST, `NetworkController - Unknown rpc type "${type}"`)
|
assert(INFURA_PROVIDER_TYPES.includes(type) || type === LOCALHOST, `NetworkController - Unknown rpc type "${type}"`)
|
||||||
const providerConfig = { type }
|
const providerConfig = { type }
|
||||||
|
this.providerConfig = providerConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
resetConnection () {
|
||||||
|
this.providerConfig = this.getProviderConfig()
|
||||||
|
}
|
||||||
|
|
||||||
|
set providerConfig (providerConfig) {
|
||||||
this.providerStore.updateState(providerConfig)
|
this.providerStore.updateState(providerConfig)
|
||||||
this._switchNetwork(providerConfig)
|
this._switchNetwork(providerConfig)
|
||||||
}
|
}
|
||||||
|
@ -630,10 +630,7 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
async resetAccount () {
|
async resetAccount () {
|
||||||
const selectedAddress = this.preferencesController.getSelectedAddress()
|
const selectedAddress = this.preferencesController.getSelectedAddress()
|
||||||
this.txController.wipeTransactions(selectedAddress)
|
this.txController.wipeTransactions(selectedAddress)
|
||||||
|
this.networkController.resetConnection()
|
||||||
const networkController = this.networkController
|
|
||||||
const oldType = networkController.getProviderConfig().type
|
|
||||||
await networkController.setProviderType(oldType, true)
|
|
||||||
|
|
||||||
return selectedAddress
|
return selectedAddress
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user