Remove unused lostAccounts state (#6979)

feature/default_network_editable
Whymarrh Whitby 5 years ago committed by GitHub
parent d4db2c3de3
commit ceace71bf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/scripts/background.js
  2. 25
      app/scripts/metamask-controller.js
  3. 1
      development/states/account-list-with-imported.json
  4. 3
      development/states/accounts-loose.json
  5. 1
      development/states/add-token.json
  6. 3
      development/states/compilation-bug.json
  7. 1
      development/states/conf-tx.json
  8. 1
      development/states/confirm-new-ui.json
  9. 1
      development/states/confirm-sig-requests.json
  10. 1
      development/states/currency-localization.json
  11. 1
      development/states/first-time.json
  12. 3
      development/states/import-private-key-warning.json
  13. 3
      development/states/import-private-key.json
  14. 89
      development/states/lost-accounts.json
  15. 3
      development/states/navigate-txs.json
  16. 1
      development/states/pending-tx-insufficient.json
  17. 3
      development/states/pending-tx.json
  18. 3
      development/states/personal-sign.json
  19. 1
      development/states/private-key-export-success.json
  20. 1
      development/states/private-key-export.json
  21. 1
      development/states/send-edit.json
  22. 1
      development/states/send-new-ui.json
  23. 1
      development/states/send.json
  24. 1
      development/states/tx-list-items.json
  25. 1
      test/data/2-state.json
  26. 8
      test/unit/app/controllers/metamask-controller-test.js
  27. 2
      ui/app/pages/home/home.container.js
  28. 1
      ui/app/pages/send/tests/send-selectors-test-data.js
  29. 1
      ui/app/selectors/tests/selectors-test-data.js
  30. 23
      ui/lib/lost-accounts-notice.js

@ -142,7 +142,6 @@ setupMetamaskMeshMetrics()
* @property {Object} infuraNetworkStatus - An object of infura network status checks. * @property {Object} infuraNetworkStatus - An object of infura network status checks.
* @property {Block[]} recentBlocks - An array of recent blocks, used to calculate an effective but cheap gas price. * @property {Block[]} recentBlocks - An array of recent blocks, used to calculate an effective but cheap gas price.
* @property {Array} shapeShiftTxList - An array of objects describing shapeshift exchange attempts. * @property {Array} shapeShiftTxList - An array of objects describing shapeshift exchange attempts.
* @property {Array} lostAccounts - TODO: Remove this feature. A leftover from the version-3 migration where our seed-phrase library changed to fix a bug where some accounts were mis-generated, but we recovered the old accounts as "lost" instead of losing them.
* @property {boolean} forgottenPassword - Returns true if the user has initiated the password recovery screen, is recovering from seed phrase. * @property {boolean} forgottenPassword - Returns true if the user has initiated the password recovery screen, is recovering from seed phrase.
*/ */

@ -385,10 +385,6 @@ module.exports = class MetamaskController extends EventEmitter {
return { return {
...{ isInitialized }, ...{ isInitialized },
...this.memStore.getFlatState(), ...this.memStore.getFlatState(),
...{
// TODO: Remove usages of lost accounts
lostAccounts: [],
},
} }
} }
@ -1177,27 +1173,6 @@ module.exports = class MetamaskController extends EventEmitter {
* @property string privateKey - The private key of the account. * @property string privateKey - The private key of the account.
*/ */
/**
* Probably no longer needed, related to the Version 3 migration.
* Imports a hash of accounts to private keys into the vault.
*
* Described in:
* https://medium.com/metamask/metamask-3-migration-guide-914b79533cdd
*
* Uses the array's private keys to create a new Simple Key Pair keychain
* and add it to the keyring controller.
* @deprecated
* @param {Account[]} lostAccounts -
* @returns {Keyring[]} An array of the restored keyrings.
*/
importLostAccounts ({ lostAccounts }) {
const privKeys = lostAccounts.map(acct => acct.privateKey)
return this.keyringController.restoreKeyring({
type: 'Simple Key Pair',
data: privKeys,
})
}
//============================================================================= //=============================================================================
// END (VAULT / KEYRING RELATED METHODS) // END (VAULT / KEYRING RELATED METHODS)
//============================================================================= //=============================================================================

@ -60,7 +60,6 @@
] ]
} }
], ],
"lostAccounts": [],
"seedWords": null "seedWords": null
}, },
"appState": { "appState": {

@ -102,8 +102,7 @@
"aa25854c0379e53c957ac9382e720c577fa31fd5" "aa25854c0379e53c957ac9382e720c577fa31fd5"
] ]
} }
], ]
"lostAccounts": []
}, },
"appState": { "appState": {
"menuOpen": false, "menuOpen": false,

@ -93,7 +93,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"send": { "send": {
"gasLimit": null, "gasLimit": null,
"gasPrice": null, "gasPrice": null,

@ -103,8 +103,7 @@
"keyringTypes": [ "keyringTypes": [
"Simple Key Pair", "Simple Key Pair",
"HD Key Tree" "HD Key Tree"
], ]
"lostAccounts": []
}, },
"appState": { "appState": {
"menuOpen": false, "menuOpen": false,

@ -191,7 +191,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"frequentRpcListDetail": [] "frequentRpcListDetail": []
}, },
"appState": { "appState": {

@ -110,7 +110,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"send": { "send": {
"gasLimit": "0xea60", "gasLimit": "0xea60",
"gasPrice": "0xba43b7400", "gasPrice": "0xba43b7400",

@ -133,7 +133,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"send": { "send": {
"gasLimit": "0xea60", "gasLimit": "0xea60",
"gasPrice": "0xba43b7400", "gasPrice": "0xba43b7400",

@ -95,7 +95,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"send": { "send": {
"gasLimit": null, "gasLimit": null,
"gasPrice": null, "gasPrice": null,

@ -34,7 +34,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"tokens": [], "tokens": [],
"currentLocale": "en", "currentLocale": "en",
"preferences": { "preferences": {

@ -72,8 +72,7 @@
"01208723ba84e15da2e71656544a2963b0c06d40" "01208723ba84e15da2e71656544a2963b0c06d40"
] ]
} }
], ]
"lostAccounts": []
}, },
"appState": { "appState": {
"menuOpen": false, "menuOpen": false,

@ -44,8 +44,7 @@
"01208723ba84e15da2e71656544a2963b0c06d40" "01208723ba84e15da2e71656544a2963b0c06d40"
] ]
} }
], ]
"lostAccounts": []
}, },
"appState": { "appState": {
"menuOpen": false, "menuOpen": false,

@ -1,89 +0,0 @@
{
"metamask": {
"currentCurrency": "USD",
"lostAccounts": [
"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",
"0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b"
],
"conversionRate": 11.06608791,
"conversionDate": 1470421024,
"isInitialized": true,
"isUnlocked": true,
"currentDomain": "example.com",
"rpcTarget": "https://rawtestrpc.metamask.io/",
"identities": {
"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc": {
"name": "Wallet 1",
"address": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc",
"mayBeFauceting": false
},
"0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b": {
"name": "Wallet 2",
"address": "0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b",
"mayBeFauceting": false
},
"0xeb9e64b93097bc15f01f13eae97015c57ab64823": {
"name": "Wallet 3",
"address": "0xeb9e64b93097bc15f01f13eae97015c57ab64823",
"mayBeFauceting": false
},
"0x704107d04affddd9b66ab9de3dd7b095852e9b69": {
"name": "Wallet 4",
"address": "0x704107d04affddd9b66ab9de3dd7b095852e9b69",
"mayBeFauceting": false
}
},
"unconfTxs": {},
"accounts": {
"0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc": {
"code": "0x",
"balance": "0x100000000000",
"nonce": "0x0",
"address": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc"
},
"0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b": {
"code": "0x",
"nonce": "0x0",
"balance": "0x100000000000",
"address": "0xec1adf982415d2ef5ec55899b9bfb8bc0f29251b"
},
"0xeb9e64b93097bc15f01f13eae97015c57ab64823": {
"code": "0x",
"nonce": "0x0",
"balance": "0x100000000000",
"address": "0xeb9e64b93097bc15f01f13eae97015c57ab64823"
},
"0x704107d04affddd9b66ab9de3dd7b095852e9b69": {
"code": "0x",
"balance": "0x0",
"nonce": "0x0",
"address": "0x704107d04affddd9b66ab9de3dd7b095852e9b69"
}
},
"transactions": [],
"network": "2",
"seedWords": null,
"unconfMsgs": {},
"messages": [],
"provider": {
"type": "testnet"
},
"selectedAddress": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc"
},
"appState": {
"menuOpen": false,
"currentView": {
"name": "accountDetail",
"detailView": null,
"context": "0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc"
},
"accountDetail": {
"subview": "transactions"
},
"currentDomain": "127.0.0.1:9966",
"transForward": true,
"isLoading": false,
"warning": null
},
"identities": {}
}

@ -232,8 +232,7 @@
"rinkeby": "ok", "rinkeby": "ok",
"ropsten": "ok", "ropsten": "ok",
"goerli": "ok" "goerli": "ok"
}, }
"lostAccounts": []
}, },
"appState": { "appState": {
"shouldClose": false, "shouldClose": false,

@ -86,7 +86,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"seedWords": null "seedWords": null
}, },
"appState": { "appState": {

@ -707,8 +707,7 @@
"rinkeby": "ok", "rinkeby": "ok",
"goerli": "ok" "goerli": "ok"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": []
"lostAccounts": []
}, },
"appState": { "appState": {
"shouldClose": true, "shouldClose": true,

@ -78,8 +78,7 @@
"provider": { "provider": {
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": []
"lostAccounts": []
}, },
"appState": { "appState": {
"menuOpen": false, "menuOpen": false,

@ -48,7 +48,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"seedWords": null "seedWords": null
}, },
"appState": { "appState": {

@ -48,7 +48,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"seedWords": null "seedWords": null
}, },
"appState": { "appState": {

@ -128,7 +128,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"send": { "send": {
"gasLimit": "0xea60", "gasLimit": "0xea60",
"gasPrice": "0xba43b7400", "gasPrice": "0xba43b7400",

@ -96,7 +96,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"send": { "send": {
"gasLimit": null, "gasLimit": null,
"gasPrice": null, "gasPrice": null,

@ -86,7 +86,6 @@
"type": "testnet" "type": "testnet"
}, },
"shapeShiftTxList": [], "shapeShiftTxList": [],
"lostAccounts": [],
"frequentRpcListDetail": [] "frequentRpcListDetail": []
}, },
"appState": { "appState": {

@ -1053,7 +1053,6 @@
{"depositAddress":"34vJ3AfmNcLiziA4VFgEVcQTwxVLD1qkke","depositType":"BTC","key":"shapeshift","response":{"status":"no_deposits","address":"34vJ3AfmNcLiziA4VFgEVcQTwxVLD1qkke"},"time":1522347459106}, {"depositAddress":"34vJ3AfmNcLiziA4VFgEVcQTwxVLD1qkke","depositType":"BTC","key":"shapeshift","response":{"status":"no_deposits","address":"34vJ3AfmNcLiziA4VFgEVcQTwxVLD1qkke"},"time":1522347459106},
{"depositAddress":"34vJ3AfmNcLiziA4VFgEVcQTwxVLD1qkkq","depositType":"BTC","key":"shapeshift","response":{"status":"no_deposits","address":"34vJ3AfmNcLiziA4VFgEVcQTwxVLD1qkkq"},"time":1522345459106} {"depositAddress":"34vJ3AfmNcLiziA4VFgEVcQTwxVLD1qkkq","depositType":"BTC","key":"shapeshift","response":{"status":"no_deposits","address":"34vJ3AfmNcLiziA4VFgEVcQTwxVLD1qkkq"},"time":1522345459106}
], ],
"lostAccounts": [],
"send": {}, "send": {},
"currentLocale": "en", "currentLocale": "en",
"preferences": { "preferences": {

@ -64,7 +64,6 @@
"noActiveNotices": true, "noActiveNotices": true,
"shapeShiftTxList": [], "shapeShiftTxList": [],
"infuraNetworkStatus": {}, "infuraNetworkStatus": {},
"lostAccounts": [],
"seedWords": "debris dizzy just program just float decrease vacant alarm reduce speak stadium", "seedWords": "debris dizzy just program just float decrease vacant alarm reduce speak stadium",
"forgottenPassword": null "forgottenPassword": null
} }

@ -758,14 +758,6 @@ describe('MetaMaskController', function () {
}) })
}) })
describe('#markAccountsFound', function () {
it('adds lost accounts to config manager data', function () {
metamaskController.markAccountsFound(noop)
const state = metamaskController.getState()
assert.deepEqual(state.lostAccounts, [])
})
})
describe('#markPasswordForgotten', function () { describe('#markPasswordForgotten', function () {
it('adds and sets forgottenPassword to config data to true', function () { it('adds and sets forgottenPassword to config data to true', function () {
metamaskController.markPasswordForgotten(noop) metamaskController.markPasswordForgotten(noop)

@ -19,7 +19,6 @@ const mapStateToProps = state => {
const { const {
approvedOrigins, approvedOrigins,
dismissedOrigins, dismissedOrigins,
lostAccounts,
suggestedTokens, suggestedTokens,
providerRequests, providerRequests,
migratedPrivacyMode, migratedPrivacyMode,
@ -42,7 +41,6 @@ const mapStateToProps = state => {
const isPopup = getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_POPUP const isPopup = getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_POPUP
return { return {
lostAccounts,
forgottenPassword, forgottenPassword,
suggestedTokens, suggestedTokens,
unconfirmedTransactionsCount: unconfirmedTransactionsCountSelector(state), unconfirmedTransactionsCount: unconfirmedTransactionsCountSelector(state),

@ -157,7 +157,6 @@ module.exports = {
{ id: 'shapeShiftTx2', 'time': 1575000000000 }, { id: 'shapeShiftTx2', 'time': 1575000000000 },
{ id: 'shapeShiftTx3', 'time': 1475000000000 }, { id: 'shapeShiftTx3', 'time': 1475000000000 },
], ],
'lostAccounts': [],
'send': { 'send': {
'gasLimit': '0xFFFF', 'gasLimit': '0xFFFF',
'gasPrice': '0xaa', 'gasPrice': '0xaa',

@ -157,7 +157,6 @@ module.exports = {
{ id: 'shapeShiftTx2', 'time': 1575000000000 }, { id: 'shapeShiftTx2', 'time': 1575000000000 },
{ id: 'shapeShiftTx3', 'time': 1475000000000 }, { id: 'shapeShiftTx3', 'time': 1475000000000 },
], ],
'lostAccounts': [],
'send': { 'send': {
'gasLimit': '0xFFFF', 'gasLimit': '0xFFFF',
'gasPrice': '0xaa', 'gasPrice': '0xaa',

@ -1,23 +0,0 @@
const summary = require('../app/helpers/utils/util').addressSummary
module.exports = function (lostAccounts) {
return {
date: new Date().toDateString(),
title: 'Account Problem Caught',
body: `MetaMask has fixed a bug where some accounts were previously mis-generated. This was a rare issue, but you were affected!
We have successfully imported the accounts that were mis-generated, but they will no longer be recovered with your normal seed phrase.
We have marked the affected accounts as "Loose", and recommend you transfer ether and tokens away from those accounts, or export & back them up elsewhere.
Your affected accounts are:
${lostAccounts.map(acct => ` - ${summary(acct)}`).join('\n')}
These accounts have been marked as "Loose" so they will be easy to recognize in the account list.
For more information, please read [our blog post.][1]
[1]: https://medium.com/metamask/metamask-3-migration-guide-914b79533cdd#.7d8ktj4h3
`,
}
}
Loading…
Cancel
Save