mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add tolerance for hex prefixed private keys to simple keychain
This commit is contained in:
parent
5e8a344f97
commit
edc5f9e821
@ -19,9 +19,10 @@ class SimpleKeyring extends EventEmitter {
|
|||||||
return Promise.resolve(this.wallets.map(w => w.getPrivateKey().toString('hex')))
|
return Promise.resolve(this.wallets.map(w => w.getPrivateKey().toString('hex')))
|
||||||
}
|
}
|
||||||
|
|
||||||
deserialize (wallets = []) {
|
deserialize (privateKeys = []) {
|
||||||
this.wallets = wallets.map((w) => {
|
this.wallets = privateKeys.map((w) => {
|
||||||
var b = new Buffer(w, 'hex')
|
const stripped = ethUtil.stripHexPrefix(w)
|
||||||
|
const b = new Buffer(stripped, 'hex')
|
||||||
const wallet = Wallet.fromPrivateKey(b)
|
const wallet = Wallet.fromPrivateKey(b)
|
||||||
return wallet
|
return wallet
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user