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:
parent
d3e0e7fe45
commit
60fec24c00
@ -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…
Reference in New Issue
Block a user