diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-01-03 05:55:43 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-01-03 05:55:43 +0800 |
commit | edc5f9e821bf18fa6ec984e645790fba3457d0bb (patch) | |
tree | e20abed6f2f4fe74ee6b168c9cab99ed76365020 /app | |
parent | 5e8a344f973fabb331db9b491247396117aa67b1 (diff) | |
download | tangerine-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.js | 7 |
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 }) |