diff options
author | Dan Finlay <flyswatter@users.noreply.github.com> | 2017-01-03 09:49:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-03 09:49:04 +0800 |
commit | fe61fcb0fcbee05724b77f9729660c9f692a0cb1 (patch) | |
tree | e81657c2671e25fbbba9e9bc3a62828269c38da5 /app/scripts/metamask-controller.js | |
parent | 305cda4265e84d520d21c473a796e8f71febc57f (diff) | |
parent | b93cdd428b5013787f78a266bcb5ca84d26b9941 (diff) | |
download | tangerine-wallet-browser-fe61fcb0fcbee05724b77f9729660c9f692a0cb1.tar tangerine-wallet-browser-fe61fcb0fcbee05724b77f9729660c9f692a0cb1.tar.gz tangerine-wallet-browser-fe61fcb0fcbee05724b77f9729660c9f692a0cb1.tar.bz2 tangerine-wallet-browser-fe61fcb0fcbee05724b77f9729660c9f692a0cb1.tar.lz tangerine-wallet-browser-fe61fcb0fcbee05724b77f9729660c9f692a0cb1.tar.xz tangerine-wallet-browser-fe61fcb0fcbee05724b77f9729660c9f692a0cb1.tar.zst tangerine-wallet-browser-fe61fcb0fcbee05724b77f9729660c9f692a0cb1.zip |
Merge branch 'dev' into i897-ReplayProtection
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 31bb4a9c2..86eab9d9c 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -63,16 +63,19 @@ module.exports = class MetamaskController { } getState () { - return extend( - this.state, - this.ethStore.getState(), - this.configManager.getConfig(), - this.keyringController.getState(), - this.txManager.getState(), - this.noticeController.getState(), { - lostAccounts: this.configManager.getLostAccounts(), - } - ) + return this.keyringController.getState() + .then((keyringControllerState) => { + return extend( + this.state, + this.ethStore.getState(), + this.configManager.getConfig(), + this.txManager.getState(), + keyringControllerState, + this.noticeController.getState(), { + lostAccounts: this.configManager.getLostAccounts(), + } + ) + }) } getApi () { @@ -81,7 +84,7 @@ module.exports = class MetamaskController { const noticeController = this.noticeController return { - getState: (cb) => { cb(null, this.getState()) }, + getState: nodeify(this.getState.bind(this)), setRpcTarget: this.setRpcTarget.bind(this), setProviderType: this.setProviderType.bind(this), useEtherscanProvider: this.useEtherscanProvider.bind(this), @@ -101,7 +104,7 @@ module.exports = class MetamaskController { setLocked: nodeify(keyringController.setLocked).bind(keyringController), submitPassword: (password, cb) => { this.migrateOldVaultIfAny(password) - .then(keyringController.submitPassword.bind(keyringController)) + .then(keyringController.submitPassword.bind(keyringController, password)) .then((newState) => { cb(null, newState) }) .catch((reason) => { cb(reason) }) }, @@ -471,7 +474,7 @@ module.exports = class MetamaskController { return this.idStoreMigrator.migratedVaultForPassword(password) .then(this.restoreOldVaultAccounts.bind(this)) .then(this.restoreOldLostAccounts.bind(this)) - .then(keyringController.persistAllKeyrings.bind(keyringController)) + .then(keyringController.persistAllKeyrings.bind(keyringController, password)) .then(() => password) } |