diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-02-25 08:36:29 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-02-25 08:36:29 +0800 |
commit | f2851402f39a12c2a11e5dea7312c55b81c481cb (patch) | |
tree | 701369623079f284fc7d19d1c0d5cc39b1bccb10 | |
parent | a35229e8d409245df4302964b184a34d1e48ca63 (diff) | |
download | tangerine-wallet-browser-f2851402f39a12c2a11e5dea7312c55b81c481cb.tar tangerine-wallet-browser-f2851402f39a12c2a11e5dea7312c55b81c481cb.tar.gz tangerine-wallet-browser-f2851402f39a12c2a11e5dea7312c55b81c481cb.tar.bz2 tangerine-wallet-browser-f2851402f39a12c2a11e5dea7312c55b81c481cb.tar.lz tangerine-wallet-browser-f2851402f39a12c2a11e5dea7312c55b81c481cb.tar.xz tangerine-wallet-browser-f2851402f39a12c2a11e5dea7312c55b81c481cb.tar.zst tangerine-wallet-browser-f2851402f39a12c2a11e5dea7312c55b81c481cb.zip |
Mostly fix personal_recover
-rw-r--r-- | app/scripts/keyring-controller.js | 11 | ||||
-rw-r--r-- | app/scripts/metamask-controller.js | 1 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 8c379b5b9..f2891db37 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -5,7 +5,8 @@ const EventEmitter = require('events').EventEmitter const ObservableStore = require('obs-store') const filter = require('promise-filter') const encryptor = require('browser-passworder') -const normalizeAddress = require('eth-sig-util').normalize +const sigUtil = require('eth-sig-util') +const normalizeAddress = sigUtil.normalize // Keyrings: const SimpleKeyring = require('eth-simple-keyring') const HdKeyring = require('eth-hd-keyring') @@ -284,11 +285,8 @@ class KeyringController extends EventEmitter { // // recovers a signature of the prefixed-style personalMessage signature. recoverPersonalMessage (msgParams) { - const address = normalizeAddress(msgParams.from) - return this.getKeyringForAccount(address) - .then((keyring) => { - return keyring.recoverPersonalMessage(address, msgParams.data) - }) + const address = sigUtil.recoverPersonalSignature(msgParams) + return Promise.resolve(address) } // PRIVATE METHODS @@ -500,6 +498,7 @@ class KeyringController extends EventEmitter { // the specified `address` if one exists. getKeyringForAccount (address) { const hexed = normalizeAddress(address) + log.debug(`KeyringController - getKeyringForAccount: ${hexed}`) return Promise.all(this.keyrings.map((keyring) => { return Promise.all([ diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index eace72c24..995db1c0a 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -534,6 +534,7 @@ module.exports = class MetamaskController extends EventEmitter { } recoverPersonalMessage (msgParams) { + log.debug(`MetaMaskController - recoverPersonalMessage: ${JSON.stringify(msgParams)}`) const keyringController = this.keyringController return keyringController.recoverPersonalMessage(msgParams) } |