From 8684fc40c78cb5293d85f751cf3927c14067d343 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 21 Feb 2017 14:41:55 -0800 Subject: [PATCH] Allow provider to init before keyringController --- app/scripts/metamask-controller.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 06c133bb2..d58d1c22d 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -151,7 +151,6 @@ module.exports = class MetamaskController extends EventEmitter { // initializeProvider () { - const keyringController = this.keyringController let provider = MetaMaskProvider({ static: { @@ -173,7 +172,7 @@ module.exports = class MetamaskController extends EventEmitter { // new style msg signing approvePersonalMessage: this.approvePersonalMessage.bind(this), signPersonalMessage: nodeify(this.signPersonalMessage).bind(this), - personalRecoverSigner: nodeify(keyringController.recoverPersonalMessage).bind(keyringController), + personalRecoverSigner: nodeify(this.recoverPersonalMessage).bind(this), }) return provider } @@ -493,6 +492,11 @@ module.exports = class MetamaskController extends EventEmitter { }) } + recoverPersonalMessage (msgParams) { + const keyringController = this.keyringController + return keyringController.recoverPersonalMessage(msgParams) + } + markAccountsFound (cb) { this.configManager.setLostAccounts([]) this.sendUpdate()