1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

Debugged by using a real dapp

This commit is contained in:
Dan Finlay 2016-06-24 17:00:35 -07:00
parent d3e0e7fe45
commit 60fec24c00

View File

@ -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),
}