aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-11-19 08:04:19 +0800
committerGitHub <noreply@github.com>2016-11-19 08:04:19 +0800
commitdf5f99fa3b95f73befa0dd547900f4e4404ca46a (patch)
tree5eb47355bacc1362bac4e9a2e6a802181d083838 /app
parent626903e9f237163fe00132c777435caa845ad3f3 (diff)
parentbc6312e9e3d3a48b886f53279f13f176c71e4019 (diff)
downloadtangerine-wallet-browser-df5f99fa3b95f73befa0dd547900f4e4404ca46a.tar
tangerine-wallet-browser-df5f99fa3b95f73befa0dd547900f4e4404ca46a.tar.gz
tangerine-wallet-browser-df5f99fa3b95f73befa0dd547900f4e4404ca46a.tar.bz2
tangerine-wallet-browser-df5f99fa3b95f73befa0dd547900f4e4404ca46a.tar.lz
tangerine-wallet-browser-df5f99fa3b95f73befa0dd547900f4e4404ca46a.tar.xz
tangerine-wallet-browser-df5f99fa3b95f73befa0dd547900f4e4404ca46a.tar.zst
tangerine-wallet-browser-df5f99fa3b95f73befa0dd547900f4e4404ca46a.zip
Merge pull request #824 from MetaMask/failing-tests
Promisify persistence of old vaults in migration code
Diffstat (limited to 'app')
-rw-r--r--app/scripts/keyring-controller.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index 9046108c0..cf761c88c 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -127,8 +127,9 @@ module.exports = class KeyringController extends EventEmitter {
if (serialized && shouldMigrate) {
const keyring = this.restoreKeyring(serialized)
this.keyrings.push(keyring)
- this.persistAllKeyrings()
this.configManager.setSelectedAccount(keyring.getAccounts()[0])
+ return this.persistAllKeyrings()
+ .then(() => { return key })
}
return key
})
@@ -274,13 +275,12 @@ module.exports = class KeyringController extends EventEmitter {
}
persistAllKeyrings () {
- const serialized = this.keyrings.map((k) => {
+ const serialized = this.keyrings.map((keyring) => {
return {
- type: k.type,
- data: k.serialize(),
+ type: keyring.type,
+ data: keyring.serialize(),
}
})
-
return this.encryptor.encryptWithKey(this.key, serialized)
.then((encryptedString) => {
this.configManager.setVault(encryptedString)