1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

add documentation

This commit is contained in:
Csaba Solya 2018-03-04 08:47:46 +01:00
parent 2b86d65d0c
commit f7d4a1080d
2 changed files with 9 additions and 0 deletions

View File

@ -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) => {

View File

@ -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]