Debugged by using a real dapp

feature/default_network_editable
Dan Finlay 8 years ago
parent d3e0e7fe45
commit 60fec24c00
  1. 7
      app/scripts/metamask-controller.js

@ -10,6 +10,7 @@ const ConfigManager = require('./lib/config-manager')
module.exports = class MetamaskController {
constructor (opts) {
this.opts = opts
this.configManager = new ConfigManager(opts)
this.idStore = new IdentityStore({
configManager: this.configManager,
@ -108,16 +109,16 @@ module.exports = class MetamaskController {
var providerOpts = {
rpcUrl: this.configManager.getCurrentRpcAddress(),
// account mgmt
getAccounts: function (cb) {
getAccounts: (cb) => {
var selectedAddress = idStore.getSelectedAddress()
var result = selectedAddress ? [selectedAddress] : []
cb(null, result)
},
// tx signing
approveTransaction: this.newUnsignedTransaction,
approveTransaction: this.newUnsignedTransaction.bind(this),
signTransaction: idStore.signTransaction.bind(idStore),
// msg signing
approveMessage: this.newUnsignedMessage,
approveMessage: this.newUnsignedMessage.bind(this),
signMessage: idStore.signMessage.bind(idStore),
}

Loading…
Cancel
Save