1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge pull request #3760 from MetaMask/i3439-ResetCacheOnAccountReset

Fix bug where resetAccount does not clear network cache
This commit is contained in:
kumavis 2018-03-27 19:10:31 -07:00 committed by GitHub
commit f7a2dc984e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 34 deletions

View File

@ -2,6 +2,8 @@
## Current Master
- Fix bug where the "Reset account" feature would not clear the network cache.
## 4.4.0 Mon Mar 26 2018
- Internationalization: Taiwanese, Thai, Slovenian

View File

@ -367,7 +367,7 @@ module.exports = class MetamaskController extends EventEmitter {
placeSeedWords: this.placeSeedWords.bind(this),
verifySeedPhrase: nodeify(this.verifySeedPhrase, this),
clearSeedWordCache: this.clearSeedWordCache.bind(this),
resetAccount: this.resetAccount.bind(this),
resetAccount: nodeify(this.resetAccount, this),
importAccountWithStrategy: this.importAccountWithStrategy.bind(this),
// vault management
@ -585,10 +585,15 @@ module.exports = class MetamaskController extends EventEmitter {
/**
* ?
*/
resetAccount (cb) {
async resetAccount (cb) {
const selectedAddress = this.preferencesController.getSelectedAddress()
this.txController.wipeTransactions(selectedAddress)
cb(null, selectedAddress)
const networkController = this.networkController
const oldType = networkController.getProviderConfig().type
await networkController.setProviderType(oldType, true)
return selectedAddress
}
/**