From 57759aa12e6cb4995f6a8a6dfbba1a95e53ead92 Mon Sep 17 00:00:00 2001 From: Erik Marks Date: Wed, 18 Mar 2020 09:54:18 -0700 Subject: [PATCH] update keyring controller, us its unlock event --- app/scripts/metamask-controller.js | 3 +-- package.json | 2 +- yarn.lock | 17 ++++++++++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index b61ee51c27c3..7c792d58e531 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -1786,7 +1786,6 @@ export default class MetamaskController extends EventEmitter { const wasLocked = !isUnlocked if (wasLocked) { - this.emit('unlocked') const oldSelectedAddress = this.preferencesController.getSelectedAddress() if (!addresses.includes(oldSelectedAddress)) { const address = addresses[0] @@ -1818,7 +1817,7 @@ export default class MetamaskController extends EventEmitter { * @param {Function} handler - The event handler. */ addUnlockListener (handler) { - this.on('unlocked', handler) + this.keyringController.on('unlock', handler) } //============================================================================= diff --git a/package.json b/package.json index 5107f687b4b7..53b4608794f7 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "eth-json-rpc-filters": "^4.1.1", "eth-json-rpc-infura": "^4.0.2", "eth-json-rpc-middleware": "^4.4.1", - "eth-keyring-controller": "^5.5.0", + "eth-keyring-controller": "^5.6.0", "eth-method-registry": "^1.2.0", "eth-phishing-detect": "^1.1.4", "eth-query": "^2.1.2", diff --git a/yarn.lock b/yarn.lock index f523132c9c9c..a411fe6faf19 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10386,7 +10386,7 @@ eth-json-rpc-middleware@^4.1.4, eth-json-rpc-middleware@^4.1.5, eth-json-rpc-mid pify "^3.0.0" safe-event-emitter "^1.0.1" -eth-keyring-controller@^5.3.0, eth-keyring-controller@^5.5.0: +eth-keyring-controller@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-5.5.0.tgz#f8b78f69a0b0005873af2d1a6b2c655d6de51351" integrity sha512-kWaukiHLMYNYtB/1vZyj1r1G6wU8u+DIYVMq8QUyFAxwcBnemsKISVPIXgltgXkuUiB/t9oXsA54bWBredgrVg== @@ -10401,6 +10401,21 @@ eth-keyring-controller@^5.3.0, eth-keyring-controller@^5.5.0: loglevel "^1.5.0" obs-store "^4.0.3" +eth-keyring-controller@^5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-5.6.0.tgz#2c851c9b2e6fe5b16285c1a82056577375ac32f4" + integrity sha512-KVoC9dGU1V+VrnNJ9DkXgxEYmXPnAbwsLVdKNgiHGEsxk1/y3gO79HFeoWnjZgfapsMm1lTRdjSWW2xYVyreoA== + dependencies: + bip39 "^2.4.0" + bluebird "^3.5.0" + browser-passworder "^2.0.3" + eth-hd-keyring "^3.5.0" + eth-sig-util "^1.4.0" + eth-simple-keyring "^3.5.0" + ethereumjs-util "^5.1.2" + loglevel "^1.5.0" + obs-store "^4.0.3" + eth-lib@0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca"