diff options
Diffstat (limited to 'app/scripts/keyrings/hd.js')
-rw-r--r-- | app/scripts/keyrings/hd.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/scripts/keyrings/hd.js b/app/scripts/keyrings/hd.js index 90052d9e7..d0ebee419 100644 --- a/app/scripts/keyrings/hd.js +++ b/app/scripts/keyrings/hd.js @@ -16,11 +16,11 @@ module.exports = class HdKeyring extends EventEmitter { constructor(opts = {}) { super() this.type = type - this.opts = opts || {} this.deserialize(opts) } - deserialize(opts) { + deserialize(opts = {}) { + this.opts = opts || {} this.wallets = [] this.mnemonic = null this.root = null @@ -32,12 +32,11 @@ module.exports = class HdKeyring extends EventEmitter { if ('n' in opts) { this.addAccounts(opts.n) } - } initFromMnemonic(mnemonic) { - const seed = bip39.mnemonicToSeed(mnemonic) this.mnemonic = mnemonic + const seed = bip39.mnemonicToSeed(mnemonic) this.hdWallet = hdkey.fromMasterSeed(seed) this.root = this.hdWallet.derivePath(hdPathString) } |