From 626b52d24a3db05bf4f4e05df53f886615cc9538 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 21 Oct 2016 13:11:30 -0700 Subject: Fix bug in new KeyringController vault restoring logic. --- app/scripts/keyring-controller.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app/scripts') diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 5cf2542cc..807752a94 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -18,6 +18,8 @@ module.exports = class KeyringController extends EventEmitter { this.configManager = opts.configManager this.ethStore = opts.ethStore this.encryptor = encryptor + this.keyringTypes = keyringTypes + this.keyrings = [] this.identities = {} // Essentially a name hash } @@ -37,7 +39,7 @@ module.exports = class KeyringController extends EventEmitter { currentFiat: this.configManager.getCurrentFiat(), conversionRate: this.configManager.getConversionRate(), conversionDate: this.configManager.getConversionDate(), - keyringTypes: keyringTypes.map((krt) => krt.type()), + keyringTypes: this.keyringTypes.map((krt) => krt.type()), identities: this.identities, } } @@ -154,7 +156,7 @@ module.exports = class KeyringController extends EventEmitter { }) } - restoreKeyring(serialized, i) { + restoreKeyring(i, serialized) { const { type, data } = serialized const Keyring = this.getKeyringClassForType(type) const keyring = new Keyring() @@ -168,7 +170,7 @@ module.exports = class KeyringController extends EventEmitter { } getKeyringClassForType(type) { - const Keyring = keyringTypes.reduce((res, kr) => { + const Keyring = this.keyringTypes.reduce((res, kr) => { if (kr.type() === type) { return kr } else { -- cgit v1.2.3