mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge branch 'dev' into failing-tests
This commit is contained in:
commit
c695d54b01
@ -117,7 +117,6 @@ module.exports = class KeyringController extends EventEmitter {
|
|||||||
migrateAndGetKey (password) {
|
migrateAndGetKey (password) {
|
||||||
let key
|
let key
|
||||||
const shouldMigrate = !!this.configManager.getWallet() && !this.configManager.getVault()
|
const shouldMigrate = !!this.configManager.getWallet() && !this.configManager.getVault()
|
||||||
|
|
||||||
return this.loadKey(password)
|
return this.loadKey(password)
|
||||||
.then((derivedKey) => {
|
.then((derivedKey) => {
|
||||||
key = derivedKey
|
key = derivedKey
|
||||||
@ -128,6 +127,7 @@ module.exports = class KeyringController extends EventEmitter {
|
|||||||
if (serialized && shouldMigrate) {
|
if (serialized && shouldMigrate) {
|
||||||
const keyring = this.restoreKeyring(serialized)
|
const keyring = this.restoreKeyring(serialized)
|
||||||
this.keyrings.push(keyring)
|
this.keyrings.push(keyring)
|
||||||
|
this.persistAllKeyrings()
|
||||||
this.configManager.setSelectedAccount(keyring.getAccounts()[0])
|
this.configManager.setSelectedAccount(keyring.getAccounts()[0])
|
||||||
}
|
}
|
||||||
return key
|
return key
|
||||||
|
@ -37,11 +37,11 @@ module.exports = class IdentityStoreMigrator {
|
|||||||
|
|
||||||
serializeVault () {
|
serializeVault () {
|
||||||
const mnemonic = this.idStore._idmgmt.getSeed()
|
const mnemonic = this.idStore._idmgmt.getSeed()
|
||||||
const n = this.idStore._getAddresses().length
|
const numberOfAccounts = this.idStore._getAddresses().length
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: 'HD Key Tree',
|
type: 'HD Key Tree',
|
||||||
data: { mnemonic, n },
|
data: { mnemonic, numberOfAccounts },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user