aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-01-03 05:55:43 +0800
committerDan Finlay <dan@danfinlay.com>2017-01-03 05:55:43 +0800
commitedc5f9e821bf18fa6ec984e645790fba3457d0bb (patch)
treee20abed6f2f4fe74ee6b168c9cab99ed76365020 /app
parent5e8a344f973fabb331db9b491247396117aa67b1 (diff)
downloadtangerine-wallet-browser-edc5f9e821bf18fa6ec984e645790fba3457d0bb.tar
tangerine-wallet-browser-edc5f9e821bf18fa6ec984e645790fba3457d0bb.tar.gz
tangerine-wallet-browser-edc5f9e821bf18fa6ec984e645790fba3457d0bb.tar.bz2
tangerine-wallet-browser-edc5f9e821bf18fa6ec984e645790fba3457d0bb.tar.lz
tangerine-wallet-browser-edc5f9e821bf18fa6ec984e645790fba3457d0bb.tar.xz
tangerine-wallet-browser-edc5f9e821bf18fa6ec984e645790fba3457d0bb.tar.zst
tangerine-wallet-browser-edc5f9e821bf18fa6ec984e645790fba3457d0bb.zip
Add tolerance for hex prefixed private keys to simple keychain
Diffstat (limited to 'app')
-rw-r--r--app/scripts/keyrings/simple.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/scripts/keyrings/simple.js b/app/scripts/keyrings/simple.js
index 8f339cf80..6b4f9e710 100644
--- a/app/scripts/keyrings/simple.js
+++ b/app/scripts/keyrings/simple.js
@@ -19,9 +19,10 @@ class SimpleKeyring extends EventEmitter {
return Promise.resolve(this.wallets.map(w => w.getPrivateKey().toString('hex')))
}
- deserialize (wallets = []) {
- this.wallets = wallets.map((w) => {
- var b = new Buffer(w, 'hex')
+ deserialize (privateKeys = []) {
+ this.wallets = privateKeys.map((w) => {
+ const stripped = ethUtil.stripHexPrefix(w)
+ const b = new Buffer(stripped, 'hex')
const wallet = Wallet.fromPrivateKey(b)
return wallet
})