From 230a0ab876df82edc8147fd3c0ba18f10ffc4e3c Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 23 Nov 2016 11:58:34 -0800 Subject: Fix more keyring asyncifying tests --- app/scripts/keyring-controller.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index a36f5b752..f93202523 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -281,7 +281,7 @@ module.exports = class KeyringController extends EventEmitter { } persistAllKeyrings () { - Promise.all(this.keyrings.map((keyring) => { + return Promise.all(this.keyrings.map((keyring) => { return Promise.all([keyring.type, keyring.serialize()]) .then((serializedKeyringArray) => { // Label the output values on each serialized Keyring: @@ -314,13 +314,14 @@ module.exports = class KeyringController extends EventEmitter { const { type, data } = serialized const Keyring = this.getKeyringClassForType(type) const keyring = new Keyring() - keyring.deserialize(data) + return keyring.deserialize(data) .then(() => { return keyring.getAccounts() }) .then((accounts) => { this.setupAccounts(accounts) this.keyrings.push(keyring) + return keyring }) } -- cgit v1.2.3