From edc5f9e821bf18fa6ec984e645790fba3457d0bb Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 2 Jan 2017 13:55:43 -0800 Subject: Add tolerance for hex prefixed private keys to simple keychain --- app/scripts/keyrings/simple.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app') 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 }) -- cgit v1.2.3