diff options
author | Frankie <frankie.diamond@gmail.com> | 2016-12-24 04:48:36 +0800 |
---|---|---|
committer | Frankie <frankie.diamond@gmail.com> | 2016-12-24 04:48:36 +0800 |
commit | fa3e708f34fce523601c39b3131bdbe858d2f85f (patch) | |
tree | 9cb3b8fb5622aa23d4856e21405f8939505d3271 /app/scripts/lib | |
parent | fde69ea0baf32b5d2a6932b73f4772e983aef552 (diff) | |
parent | 2ab34760b0e2e006c0b87722e8397c642eb86981 (diff) | |
download | tangerine-wallet-browser-fa3e708f34fce523601c39b3131bdbe858d2f85f.tar tangerine-wallet-browser-fa3e708f34fce523601c39b3131bdbe858d2f85f.tar.gz tangerine-wallet-browser-fa3e708f34fce523601c39b3131bdbe858d2f85f.tar.bz2 tangerine-wallet-browser-fa3e708f34fce523601c39b3131bdbe858d2f85f.tar.lz tangerine-wallet-browser-fa3e708f34fce523601c39b3131bdbe858d2f85f.tar.xz tangerine-wallet-browser-fa3e708f34fce523601c39b3131bdbe858d2f85f.tar.zst tangerine-wallet-browser-fa3e708f34fce523601c39b3131bdbe858d2f85f.zip |
Merge branch 'dev' into TxManager
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/config-manager.js | 2 | ||||
-rw-r--r-- | app/scripts/lib/idStore-migrator.js | 7 | ||||
-rw-r--r-- | app/scripts/lib/idStore.js | 3 | ||||
-rw-r--r-- | app/scripts/lib/inpage-provider.js | 4 |
4 files changed, 11 insertions, 5 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index c723655fa..93501c859 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -118,7 +118,7 @@ ConfigManager.prototype.setVault = function (encryptedString) { ConfigManager.prototype.getVault = function () { var data = this.getData() - return ('vault' in data) && data.vault + return data.vault } ConfigManager.prototype.getKeychains = function () { diff --git a/app/scripts/lib/idStore-migrator.js b/app/scripts/lib/idStore-migrator.js index 2e9418376..655aed0af 100644 --- a/app/scripts/lib/idStore-migrator.js +++ b/app/scripts/lib/idStore-migrator.js @@ -63,7 +63,12 @@ module.exports = class IdentityStoreMigrator { return { serialized, - lostAccounts, + lostAccounts: lostAccounts.map((address) => { + return { + address, + privateKey: this.idStore.exportAccount(address), + } + }), } }) } diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 5c0f8d7f7..e4cbca456 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -190,7 +190,8 @@ IdentityStore.prototype.submitPassword = function (password, cb) { IdentityStore.prototype.exportAccount = function (address, cb) { var privateKey = this._idmgmt.exportPrivateKey(address) - cb(null, privateKey) + if (cb) cb(null, privateKey) + return privateKey } // private diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index 30fcbcb66..a64c745ce 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -72,13 +72,13 @@ MetamaskInpageProvider.prototype.send = function (payload) { case 'eth_accounts': // read from localStorage - selectedAccount = self.publicConfigStore.get('selectedAddress') + selectedAccount = self.publicConfigStore.get('selectedAccount') result = selectedAccount ? [selectedAccount] : [] break case 'eth_coinbase': // read from localStorage - selectedAccount = self.publicConfigStore.get('selectedAddress') + selectedAccount = self.publicConfigStore.get('selectedAccount') result = selectedAccount || '0x0000000000000000000000000000000000000000' break |