aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorMark Stacey <markjstacey@gmail.com>2019-07-26 21:35:21 +0800
committerGitHub <noreply@github.com>2019-07-26 21:35:21 +0800
commit1112277cd628378f8b0e659067456677ec9a45ac (patch)
tree77a4d1878ba8419a0e7400f9147bb67f44b4a177 /app/scripts
parent58965ed1643a816dca1fec608671017266709dda (diff)
downloadtangerine-wallet-browser-1112277cd628378f8b0e659067456677ec9a45ac.tar.gz
tangerine-wallet-browser-1112277cd628378f8b0e659067456677ec9a45ac.tar.zst
tangerine-wallet-browser-1112277cd628378f8b0e659067456677ec9a45ac.zip
Remove `seedWords` completely from metamask state (#6920)
`seedWords` used to be stored on the metamask state temporarily at certain points. This hasn't been the case since #5994, but references to this state remained. All of the logic remained for correctly updating these `seedWords`, handling them during navigation, and scrubbing them from the state. However the state was never updated in practice. The `seedWords` are still returned by `verifySeedPhrase`, and they're still stored in component state in a few places. But they aren't ever set in the Redux metadata state or the Preferences controller. All references to this state have been removed, along with any logic for interacting with this state. A few unused actions were removed as well.
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/background.js1
-rw-r--r--app/scripts/controllers/preferences.js9
-rw-r--r--app/scripts/metamask-controller.js34
3 files changed, 0 insertions, 44 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index 7bedfcc19..8e65bd5a4 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -116,7 +116,6 @@ setupMetamaskMeshMetrics()
* @property {boolean} useBlockie - Indicates preferred user identicon format. True for blockie, false for Jazzicon.
* @property {Object} featureFlags - An object for optional feature flags.
* @property {string} networkEndpointType - TODO: Document
- * @property {boolean} isRevealingSeedWords - True if seed words are currently being recovered, and should be shown to user.
* @property {boolean} welcomeScreen - True if welcome screen should be shown.
* @property {string} currentLocale - A locale string matching the user's preferred display language.
* @property {Object} provider - The current selected network provider.
diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js
index 86c9517f5..4197781d2 100644
--- a/app/scripts/controllers/preferences.js
+++ b/app/scripts/controllers/preferences.js
@@ -49,7 +49,6 @@ class PreferencesController {
currentLocale: opts.initLangCode,
identities: {},
lostIdentities: {},
- seedWords: null,
forgottenPassword: false,
preferences: {
useNativeCurrencyAsPrimaryCurrency: true,
@@ -80,14 +79,6 @@ class PreferencesController {
}
/**
- * Sets the {@code seedWords} seed words
- * @param {string|null} seedWords the seed words
- */
- setSeedWords (seedWords) {
- this.store.updateState({ seedWords })
- }
-
- /**
* Setter for the `useBlockie` property
*
* @param {boolean} val Whether or not the user prefers blockie indicators
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js
index 17d38d43c..84a25b008 100644
--- a/app/scripts/metamask-controller.js
+++ b/app/scripts/metamask-controller.js
@@ -420,9 +420,7 @@ module.exports = class MetamaskController extends EventEmitter {
// primary HD keyring management
addNewAccount: nodeify(this.addNewAccount, this),
- placeSeedWords: this.placeSeedWords.bind(this),
verifySeedPhrase: nodeify(this.verifySeedPhrase, this),
- clearSeedWordCache: this.clearSeedWordCache.bind(this),
resetAccount: nodeify(this.resetAccount, this),
removeAccount: nodeify(this.removeAccount, this),
importAccountWithStrategy: nodeify(this.importAccountWithStrategy, this),
@@ -845,26 +843,6 @@ module.exports = class MetamaskController extends EventEmitter {
}
/**
- * Adds the current vault's seed words to the UI's state tree.
- *
- * Used when creating a first vault, to allow confirmation.
- * Also used when revealing the seed words in the confirmation view.
- *
- * @param {Function} cb - A callback called on completion.
- */
- placeSeedWords (cb) {
-
- this.verifySeedPhrase()
- .then((seedWords) => {
- this.preferencesController.setSeedWords(seedWords)
- return cb(null, seedWords)
- })
- .catch((err) => {
- return cb(err)
- })
- }
-
- /**
* Verifies the validity of the current vault's seed phrase.
*
* Validity: seed phrase restores the accounts belonging to the current vault.
@@ -898,18 +876,6 @@ module.exports = class MetamaskController extends EventEmitter {
}
/**
- * Remove the primary account seed phrase from the UI's state tree.
- *
- * The seed phrase remains available in the background process.
- *
- * @param {function} cb Callback function called with the current address.
- */
- clearSeedWordCache (cb) {
- this.preferencesController.setSeedWords(null)
- cb(null, this.preferencesController.getSelectedAddress())
- }
-
- /**
* Clears the transaction history, to allow users to force-reset their nonces.
* Mostly used in development environments, when networks are restarted with
* the same network ID.