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')))
|
||||
}
|
||||
|
||||
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
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user