diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-11-02 02:25:38 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-11-02 02:30:10 +0800 |
commit | db356a181a3fde4ad528c699f6da517053171866 (patch) | |
tree | ba339827fef6685e097d6fc247dae47f3d0a8f70 /app/scripts/keyrings | |
parent | e2f67a2cb85552bd8fcf2f7929c14a9d028adccb (diff) | |
download | tangerine-wallet-browser-db356a181a3fde4ad528c699f6da517053171866.tar tangerine-wallet-browser-db356a181a3fde4ad528c699f6da517053171866.tar.gz tangerine-wallet-browser-db356a181a3fde4ad528c699f6da517053171866.tar.bz2 tangerine-wallet-browser-db356a181a3fde4ad528c699f6da517053171866.tar.lz tangerine-wallet-browser-db356a181a3fde4ad528c699f6da517053171866.tar.xz tangerine-wallet-browser-db356a181a3fde4ad528c699f6da517053171866.tar.zst tangerine-wallet-browser-db356a181a3fde4ad528c699f6da517053171866.zip |
Made progress on parity for MultiVault
- Deleted some unused items
- Renamed files and paths to match with new locations.
- Modified keyring controller logic to separate concerns.
- Fix account naming issues.
- Enable creation of new vault with default HD keyring.
- Formatting issues.
Diffstat (limited to 'app/scripts/keyrings')
-rw-r--r-- | app/scripts/keyrings/hd.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/app/scripts/keyrings/hd.js b/app/scripts/keyrings/hd.js index 61df8f28e..69b8d25bc 100644 --- a/app/scripts/keyrings/hd.js +++ b/app/scripts/keyrings/hd.js @@ -17,13 +17,22 @@ module.exports = class HdKeyring extends EventEmitter { super() this.type = type this.opts = opts || {} + this.deserialize(opts) + } + + deserialize(opts) { this.wallets = [] this.mnemonic = null - } + this.root = null + + if ('mnemonic' in opts) { + this.initFromMnemonic(opts.mnemonic) + } + + if ('n' in opts) { + this.addAccounts(opts.n) + } - deserialize({ mnemonic, n }) { - this.initFromMnemonic(mnemonic || bip39.generateMnemonic()) - this.addAccounts(n) } initFromMnemonic(mnemonic) { @@ -83,4 +92,3 @@ module.exports = class HdKeyring extends EventEmitter { } } - |