1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 17:33:23 +01:00

Fix password reference

This commit is contained in:
Dan Finlay 2016-11-22 16:29:46 -08:00
parent 6ebdebc0a5
commit 822face7a3
2 changed files with 3 additions and 1 deletions

View File

@ -274,8 +274,9 @@ module.exports = class KeyringController extends EventEmitter {
unlockKeyrings (password) { unlockKeyrings (password) {
const encryptedVault = this.configManager.getVault() const encryptedVault = this.configManager.getVault()
return this.encryptor.decrypt(this.password, encryptedVault) return this.encryptor.decrypt(password, encryptedVault)
.then((vault) => { .then((vault) => {
this.password = password
vault.forEach(this.restoreKeyring.bind(this)) vault.forEach(this.restoreKeyring.bind(this))
return this.keyrings return this.keyrings
}) })

View File

@ -87,6 +87,7 @@ describe('KeyringController', function() {
keyringController.migrateOldVaultIfAny(password) keyringController.migrateOldVaultIfAny(password)
.then(() => { .then(() => {
assert(keyringController.configManager.getVault(), 'now has a vault') assert(keyringController.configManager.getVault(), 'now has a vault')
assert(keyringController.password, 'has a password set')
done() done()
}) })
.catch((reason) => { .catch((reason) => {