aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/keyring-controller.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-11-01 02:35:09 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-11-01 02:35:09 +0800
commit96643c222a74552d98218fe1f9fc81e493a1960f (patch)
tree9e49503ee49ca0bce8c888c286719de5eb27f1e6 /app/scripts/keyring-controller.js
parent6fc498f8a030ea00bcef9b8b3400fc527fc4aeed (diff)
downloadtangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar
tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar.gz
tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar.bz2
tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar.lz
tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar.xz
tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.tar.zst
tangerine-wallet-browser-96643c222a74552d98218fe1f9fc81e493a1960f.zip
Implement seed word confirmation page.
Remove logs. Move HD render files to ui/app.
Diffstat (limited to 'app/scripts/keyring-controller.js')
-rw-r--r--app/scripts/keyring-controller.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js
index e7b9612bf..ee6445121 100644
--- a/app/scripts/keyring-controller.js
+++ b/app/scripts/keyring-controller.js
@@ -47,6 +47,7 @@ module.exports = class KeyringController extends EventEmitter {
getState() {
return {
+ seedWords: this.configManager.getSeedWords(),
isInitialized: !!this.configManager.getVault(),
isUnlocked: !!this.key,
isConfirmed: true, // AUDIT this.configManager.getConfirmed(),
@@ -90,10 +91,14 @@ module.exports = class KeyringController extends EventEmitter {
this.configManager.setVault(encryptedString)
if (!serialized) {
- // TEMPORARY SINGLE-KEYRING CONFIG:
- return this.addNewKeyring('HD Key Tree', null, (err, newState) => {
- const firstAccount = this.keyrings[0].getAccounts()[0]
- autoFaucet(ethUtil.addHexPrefix(firstAccount))
+ this.addNewKeyring('HD Key Tree', null, (err, newState) => {
+ const firstKeyring = this.keyrings[0]
+ const firstAccount = firstKeyring.getAccounts()[0]
+ const hexAccount = ethUtil.addHexPrefix(firstAccount)
+ const seedWords = firstKeyring.serialize().mnemonic
+ this.configManager.setSelectedAccount(hexAccount)
+ this.configManager.setSeedWords(seedWords)
+ autoFaucet(hexAccount)
cb(err, newState)
})
} else {
@@ -470,6 +475,11 @@ module.exports = class KeyringController extends EventEmitter {
return ethUtil.addHexPrefix(result.toString(16))
}
+ clearSeedWordCache(cb) {
+ this.configManager.setSeedWords(null)
+ cb(null, this.configManager.getSelectedAccount())
+ }
+
}
function noop () {}