Point metamask-controller personalSignRecover method to keyring-controller

feature/default_network_editable
Dan Finlay 8 years ago
parent 0584988688
commit 92fb07999a
  1. 14
      app/scripts/metamask-controller.js

@ -24,7 +24,6 @@ const autoFaucet = require('./lib/auto-faucet')
const nodeify = require('./lib/nodeify')
const IdStoreMigrator = require('./lib/idStore-migrator')
const accountImporter = require('./account-import-strategies')
const sigUtil = require('eth-sig-util')
const version = require('../manifest.json').version
@ -152,6 +151,8 @@ module.exports = class MetamaskController extends EventEmitter {
//
initializeProvider () {
const keyringController = this.keyringController
let provider = MetaMaskProvider({
static: {
eth_syncing: false,
@ -171,8 +172,8 @@ module.exports = class MetamaskController extends EventEmitter {
// new style msg signing
approvePersonalMessage: this.approvePersonalMessage.bind(this),
signPersonalMessage: this.signPersonalMessage.bind(this),
personalRecoverSigner: this.personalRecoverSigner.bind(this),
signPersonalMessage: nodeify(this.signPersonalMessage).bind(this),
personalRecoverSigner: nodeify(keyringController.recoverPersonalMessage).bind(keyringController),
})
return provider
}
@ -459,7 +460,7 @@ module.exports = class MetamaskController extends EventEmitter {
}
// Prefixed Style Message Signing Methods:
approvePersonalMessage (cb) {
approvePersonalMessage (msgParams, cb) {
let msgId = this.personalMessageManager.addUnapprovedMessage(msgParams)
this.sendUpdate()
this.opts.showUnconfirmedMessage()
@ -492,11 +493,6 @@ module.exports = class MetamaskController extends EventEmitter {
})
}
personalRecoverSigner (msgParams) {
const recovered = sigUtil.recoverPersonalSignature(msgParams)
return Promise.resolve(recovered)
}
markAccountsFound (cb) {
this.configManager.setLostAccounts([])
this.sendUpdate()

Loading…
Cancel
Save