diff options
Add tolerance for hex prefixed private keys to simple keychain
Diffstat (limited to 'app/scripts/keyrings/simple.js')
-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 }) |