aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/idStore-migrator.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib/idStore-migrator.js')
-rw-r--r--app/scripts/lib/idStore-migrator.js22
1 files changed, 1 insertions, 21 deletions
diff --git a/app/scripts/lib/idStore-migrator.js b/app/scripts/lib/idStore-migrator.js
index c13015b96..14bd0d8b8 100644
--- a/app/scripts/lib/idStore-migrator.js
+++ b/app/scripts/lib/idStore-migrator.js
@@ -14,31 +14,21 @@ module.exports = class IdentityStoreMigrator {
}
migratedVaultForPassword (password) {
- console.log('migrating vault for password')
const hasOldVault = this.hasOldVault()
const configManager = this.configManager
if (!this.idStore) {
- console.log('initializing id store')
this.idStore = new IdentityStore({ configManager })
- console.log('initialized')
}
if (!hasOldVault) {
- console.log('no old vault recognized')
return Promise.resolve(null)
}
- console.log('returning new promise')
return new Promise((resolve, reject) => {
- console.log('submitting password to idStore')
this.idStore.submitPassword(password, (err) => {
- console.log('returned ' + err)
if (err) return reject(err)
- console.log('serializing vault')
const serialized = this.serializeVault()
- console.log('migrated and serialized into')
- console.dir(serialized)
this.checkForErrors(serialized)
.then(resolve)
.catch(reject)
@@ -57,16 +47,9 @@ module.exports = class IdentityStoreMigrator {
}
checkForErrors (serialized) {
- console.log('checking for errors, first making hd wallet')
const hd = new HdKeyring()
- return hd.deserialize(serialized)
- .then(() => {
- console.log('deserialized, now getting accounts')
- console.dir(arguments)
- return hd.getAccounts()
- })
+ return hd.deserialize(serialized.data)
.then((hexAccounts) => {
- console.log('hd returned accounts', hexAccounts)
const newAccounts = hexAccounts.map(normalize)
const oldAccounts = this.idStore._getAddresses().map(normalize)
const lostAccounts = oldAccounts.reduce((result, account) => {
@@ -78,9 +61,6 @@ module.exports = class IdentityStoreMigrator {
}
}, [])
- console.log('migrator has')
- console.dir({ newAccounts, oldAccounts, lostAccounts, hexAccounts })
-
return {
serialized,
lostAccounts,