Skip to content

Commit

Permalink
update keyring controller, us its unlock event
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Mar 18, 2020
1 parent 6bc95aa commit 57759aa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
}

//=============================================================================
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 16 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand All @@ -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"

[email protected]:
version "0.2.7"
resolved "https://registry.yarnpkg.com/eth-lib/-/eth-lib-0.2.7.tgz#2f93f17b1e23aec3759cd4a3fe20c1286a3fc1ca"
Expand Down

0 comments on commit 57759aa

Please sign in to comment.