Merge pull request #3760 from MetaMask/i3439-ResetCacheOnAccountReset

Fix bug where resetAccount does not clear network cache
feature/default_network_editable
kumavis 7 years ago committed by GitHub
commit f7a2dc984e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 11
      app/scripts/metamask-controller.js

@ -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

@ -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
}
/**

Loading…
Cancel
Save