aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorCsaba Solya <csaba.solya@gmail.com>2018-03-04 15:47:46 +0800
committerCsaba Solya <csaba.solya@gmail.com>2018-03-04 15:47:46 +0800
commitf7d4a1080df6d1c8ea5f68f88b01caea065b5e92 (patch)
treef74d0d6118105dc62060f4ffffffdf4ed9c3ec34 /app
parent2b86d65d0c3266e8ddfe814abe1d1755fbf23fda (diff)
downloadtangerine-wallet-browser-f7d4a1080df6d1c8ea5f68f88b01caea065b5e92.tar
tangerine-wallet-browser-f7d4a1080df6d1c8ea5f68f88b01caea065b5e92.tar.gz
tangerine-wallet-browser-f7d4a1080df6d1c8ea5f68f88b01caea065b5e92.tar.bz2
tangerine-wallet-browser-f7d4a1080df6d1c8ea5f68f88b01caea065b5e92.tar.lz
tangerine-wallet-browser-f7d4a1080df6d1c8ea5f68f88b01caea065b5e92.tar.xz
tangerine-wallet-browser-f7d4a1080df6d1c8ea5f68f88b01caea065b5e92.tar.zst
tangerine-wallet-browser-f7d4a1080df6d1c8ea5f68f88b01caea065b5e92.zip
add documentation
Diffstat (limited to 'app')
-rw-r--r--app/scripts/lib/seed-phrase-verifier.js5
-rw-r--r--app/scripts/metamask-controller.js4
2 files changed, 9 insertions, 0 deletions
diff --git a/app/scripts/lib/seed-phrase-verifier.js b/app/scripts/lib/seed-phrase-verifier.js
index 1f35c2c67..9cea22029 100644
--- a/app/scripts/lib/seed-phrase-verifier.js
+++ b/app/scripts/lib/seed-phrase-verifier.js
@@ -2,6 +2,11 @@ const KeyringController = require('eth-keyring-controller')
const seedPhraseVerifier = {
+ // Verifies if the seed words can restore the accounts.
+ //
+ // The seed words can recreate the primary keyring and the accounts belonging to it.
+ // The created accounts in the primary keyring are always the same.
+ // The keyring always creates the accounts in the same sequence.
verifyAccounts (createdAccounts, seedWords) {
return new Promise((resolve, reject) => {
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index df9adc248..f523e3919 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -600,6 +600,10 @@ module.exports = class MetamaskController extends EventEmitter {
})
}
+ // Verifies the current vault's seed words if they can restore the
+ // accounts belonging to the current vault.
+ //
+ // Called when the first account is created and on unlocking the vault.
verifySeedPhrase (cb) {
const primaryKeyring = this.keyringController.getKeyringsByType('HD Key Tree')[0]