aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-02-08 08:49:14 +0800
committerDan <danjm.com@gmail.com>2018-02-08 08:49:14 +0800
commitb0db68a281168a94316823387b1670839990dd63 (patch)
tree153ca25095e5293951df032c8aa4860b2fe9965d /app/scripts/metamask-controller.js
parent7f151b861cc3a565d3feefc50b3be25ab4490ac8 (diff)
parentc50a197ab95b462b4416cbf85139f80db9b70f0c (diff)
downloadtangerine-wallet-browser-b0db68a281168a94316823387b1670839990dd63.tar
tangerine-wallet-browser-b0db68a281168a94316823387b1670839990dd63.tar.gz
tangerine-wallet-browser-b0db68a281168a94316823387b1670839990dd63.tar.bz2
tangerine-wallet-browser-b0db68a281168a94316823387b1670839990dd63.tar.lz
tangerine-wallet-browser-b0db68a281168a94316823387b1670839990dd63.tar.xz
tangerine-wallet-browser-b0db68a281168a94316823387b1670839990dd63.tar.zst
tangerine-wallet-browser-b0db68a281168a94316823387b1670839990dd63.zip
Merge branch 'uat' into uat-next
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r--app/scripts/metamask-controller.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index cb671ec3c..15a30458a 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -43,6 +43,8 @@ module.exports = class MetamaskController extends EventEmitter {
constructor (opts) {
super()
+ this.defaultMaxListeners = 20
+
this.sendUpdate = debounce(this.privateSendUpdate.bind(this), 200)
this.opts = opts
@@ -84,9 +86,7 @@ module.exports = class MetamaskController extends EventEmitter {
})
this.infuraController.scheduleInfuraNetworkCheck()
- this.blacklistController = new BlacklistController({
- initState: initState.BlacklistController,
- })
+ this.blacklistController = new BlacklistController()
this.blacklistController.scheduleUpdates()
// rpc provider
@@ -198,12 +198,7 @@ module.exports = class MetamaskController extends EventEmitter {
this.networkController.store.subscribe((state) => {
this.store.updateState({ NetworkController: state })
})
- this.blacklistController.store.subscribe((state) => {
- this.store.updateState({ BlacklistController: state })
- })
- this.recentBlocksController.store.subscribe((state) => {
- this.store.updateState({ RecentBlocks: state })
- })
+
this.infuraController.store.subscribe((state) => {
this.store.updateState({ InfuraController: state })
})
@@ -350,6 +345,7 @@ module.exports = class MetamaskController extends EventEmitter {
addNewAccount: nodeify(this.addNewAccount, this),
placeSeedWords: this.placeSeedWords.bind(this),
clearSeedWordCache: this.clearSeedWordCache.bind(this),
+ resetAccount: this.resetAccount.bind(this),
importAccountWithStrategy: this.importAccountWithStrategy.bind(this),
// vault management
@@ -610,6 +606,13 @@ module.exports = class MetamaskController extends EventEmitter {
cb(null, this.preferencesController.getSelectedAddress())
}
+ resetAccount (cb) {
+ const selectedAddress = this.preferencesController.getSelectedAddress()
+ this.txController.wipeTransactions(selectedAddress)
+ cb(null, selectedAddress)
+ }
+
+
importAccountWithStrategy (strategy, args, cb) {
accountImporter.importAccount(strategy, args)
.then((privateKey) => {