1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-30 16:18:07 +01:00

Merge branch 'dev' into messageManagerCleanUp

This commit is contained in:
Frankie 2017-01-30 00:50:02 -08:00
commit f40629e5ae
2 changed files with 13 additions and 4 deletions

View File

@ -246,6 +246,15 @@ class KeyringController extends EventEmitter {
return this.fullUpdate() return this.fullUpdate()
} }
// Get Selected Account
//
// returns String
//
// Gets the state's `selectedAccount` value
getSelectedAccount () {
return this.store.getState().selectedAccount
}
// Save Account Label // Save Account Label
// @string account // @string account
// @string label // @string label

View File

@ -65,7 +65,7 @@ module.exports = class MetamaskController extends EventEmitter {
txList: this.configManager.getTxList(), txList: this.configManager.getTxList(),
txHistoryLimit: 40, txHistoryLimit: 40,
setTxList: this.configManager.setTxList.bind(this.configManager), setTxList: this.configManager.setTxList.bind(this.configManager),
getSelectedAccount: this.configManager.getSelectedAccount.bind(this.configManager), getSelectedAccount: this.keyringController.getSelectedAccount.bind(this.keyringController),
getGasMultiplier: this.configManager.getGasMultiplier.bind(this.configManager), getGasMultiplier: this.configManager.getGasMultiplier.bind(this.configManager),
getNetwork: this.getStateNetwork.bind(this), getNetwork: this.getStateNetwork.bind(this),
signTransaction: this.keyringController.signTransaction.bind(this.keyringController), signTransaction: this.keyringController.signTransaction.bind(this.keyringController),
@ -117,7 +117,7 @@ module.exports = class MetamaskController extends EventEmitter {
rpcUrl: this.configManager.getCurrentRpcAddress(), rpcUrl: this.configManager.getCurrentRpcAddress(),
// account mgmt // account mgmt
getAccounts: (cb) => { getAccounts: (cb) => {
let selectedAccount = this.configManager.getSelectedAccount() let selectedAccount = this.keyringController.getSelectedAccount()
let result = selectedAccount ? [selectedAccount] : [] let result = selectedAccount ? [selectedAccount] : []
cb(null, result) cb(null, result)
}, },
@ -143,7 +143,7 @@ module.exports = class MetamaskController extends EventEmitter {
function selectPublicState(state) { function selectPublicState(state) {
const result = { selectedAccount: undefined } const result = { selectedAccount: undefined }
try { try {
result.selectedAccount = state.config.selectedAccount result.selectedAccount = state.KeyringController.selectedAccount
} catch (_) {} } catch (_) {}
return result return result
} }
@ -329,7 +329,7 @@ module.exports = class MetamaskController extends EventEmitter {
// ensuring they are only ever available in the background process. // ensuring they are only ever available in the background process.
clearSeedWordCache (cb) { clearSeedWordCache (cb) {
this.configManager.setSeedWords(null) this.configManager.setSeedWords(null)
cb(null, this.configManager.getSelectedAccount()) cb(null, this.keyringController.getSelectedAccount())
} }
importAccountWithStrategy (strategy, args, cb) { importAccountWithStrategy (strategy, args, cb) {