diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-11-16 03:07:15 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-11-16 03:19:21 +0800 |
commit | b1fee2a1d303c28ccedafc4e8c81e07ebf164b36 (patch) | |
tree | 7190c26be604d041f554700054312ea344a5a34d | |
parent | 7de6b12aad4a674bdbb0749d2e61d9fd5f69c536 (diff) | |
download | tangerine-wallet-browser-b1fee2a1d303c28ccedafc4e8c81e07ebf164b36.tar tangerine-wallet-browser-b1fee2a1d303c28ccedafc4e8c81e07ebf164b36.tar.gz tangerine-wallet-browser-b1fee2a1d303c28ccedafc4e8c81e07ebf164b36.tar.bz2 tangerine-wallet-browser-b1fee2a1d303c28ccedafc4e8c81e07ebf164b36.tar.lz tangerine-wallet-browser-b1fee2a1d303c28ccedafc4e8c81e07ebf164b36.tar.xz tangerine-wallet-browser-b1fee2a1d303c28ccedafc4e8c81e07ebf164b36.tar.zst tangerine-wallet-browser-b1fee2a1d303c28ccedafc4e8c81e07ebf164b36.zip |
Minimize repeated code.
-rw-r--r-- | app/scripts/keyring-controller.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index c7e3c32a4..4acaebba3 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -153,13 +153,12 @@ module.exports = class KeyringController extends EventEmitter { createFirstKeyTree (password, cb) { this.clearKeyrings() this.addNewKeyring('HD Key Tree', {numberOfAccounts: 1}, (err) => { - const firstKeyring = this.keyrings[0] - const accounts = firstKeyring.getAccounts() + const accounts = this.keyrings[0].getAccounts() const firstAccount = accounts[0] const hexAccount = normalize(firstAccount) - const seedWords = firstKeyring.serialize().mnemonic this.configManager.setSelectedAccount(firstAccount) - this.configManager.setSeedWords(seedWords) + + this.placeSeedWords() autoFaucet(hexAccount) this.setupAccounts(accounts) this.persistAllKeyrings() @@ -172,9 +171,11 @@ module.exports = class KeyringController extends EventEmitter { }) } - placeSeedWords (cb) { + placeSeedWords () { const firstKeyring = this.keyrings[0] + console.log(firstKeyring) const seedWords = firstKeyring.serialize().mnemonic + console.log(seedWords) this.configManager.setSeedWords(seedWords) } |