Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove stale lostAccounts state #6979

Merged
merged 1 commit into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ setupMetamaskMeshMetrics()
* @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 {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.
*/

Expand Down
25 changes: 0 additions & 25 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,6 @@ module.exports = class MetamaskController extends EventEmitter {
return {
...{ isInitialized },
...this.memStore.getFlatState(),
...{
// TODO: Remove usages of lost accounts
lostAccounts: [],
},
}
}

Expand Down Expand Up @@ -1177,27 +1173,6 @@ module.exports = class MetamaskController extends EventEmitter {
* @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)
//=============================================================================
Expand Down
1 change: 0 additions & 1 deletion development/states/account-list-with-imported.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
]
}
],
"lostAccounts": [],
"seedWords": null
},
"appState": {
Expand Down
3 changes: 1 addition & 2 deletions development/states/accounts-loose.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@
"aa25854c0379e53c957ac9382e720c577fa31fd5"
]
}
],
"lostAccounts": []
]
},
"appState": {
"menuOpen": false,
Expand Down
3 changes: 1 addition & 2 deletions development/states/add-token.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"send": {
"gasLimit": null,
"gasPrice": null,
Expand All @@ -104,7 +103,7 @@
"amount": "0x0",
"memo": "",
"errors": {},
"warnings": {},
"warnings": {},
"maxModeOn": false,
"editingTransactionId": null
},
Expand Down
3 changes: 1 addition & 2 deletions development/states/compilation-bug.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@
"keyringTypes": [
"Simple Key Pair",
"HD Key Tree"
],
"lostAccounts": []
]
},
"appState": {
"menuOpen": false,
Expand Down
1 change: 0 additions & 1 deletion development/states/conf-tx.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"frequentRpcListDetail": []
},
"appState": {
Expand Down
1 change: 0 additions & 1 deletion development/states/confirm-new-ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"send": {
"gasLimit": "0xea60",
"gasPrice": "0xba43b7400",
Expand Down
1 change: 0 additions & 1 deletion development/states/confirm-sig-requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"send": {
"gasLimit": "0xea60",
"gasPrice": "0xba43b7400",
Expand Down
1 change: 0 additions & 1 deletion development/states/currency-localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"send": {
"gasLimit": null,
"gasPrice": null,
Expand Down
1 change: 0 additions & 1 deletion development/states/first-time.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"tokens": [],
"currentLocale": "en",
"preferences": {
Expand Down
3 changes: 1 addition & 2 deletions development/states/import-private-key-warning.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@
"01208723ba84e15da2e71656544a2963b0c06d40"
]
}
],
"lostAccounts": []
]
},
"appState": {
"menuOpen": false,
Expand Down
3 changes: 1 addition & 2 deletions development/states/import-private-key.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
"01208723ba84e15da2e71656544a2963b0c06d40"
]
}
],
"lostAccounts": []
]
},
"appState": {
"menuOpen": false,
Expand Down
89 changes: 0 additions & 89 deletions development/states/lost-accounts.json

This file was deleted.

3 changes: 1 addition & 2 deletions development/states/navigate-txs.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@
"rinkeby": "ok",
"ropsten": "ok",
"goerli": "ok"
},
"lostAccounts": []
}
},
"appState": {
"shouldClose": false,
Expand Down
1 change: 0 additions & 1 deletion development/states/pending-tx-insufficient.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"seedWords": null
},
"appState": {
Expand Down
3 changes: 1 addition & 2 deletions development/states/pending-tx.json
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,7 @@
"rinkeby": "ok",
"goerli": "ok"
},
"shapeShiftTxList": [],
"lostAccounts": []
"shapeShiftTxList": []
},
"appState": {
"shouldClose": true,
Expand Down
3 changes: 1 addition & 2 deletions development/states/personal-sign.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@
"provider": {
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": []
"shapeShiftTxList": []
},
"appState": {
"menuOpen": false,
Expand Down
1 change: 0 additions & 1 deletion development/states/private-key-export-success.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"seedWords": null
},
"appState": {
Expand Down
1 change: 0 additions & 1 deletion development/states/private-key-export.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"seedWords": null
},
"appState": {
Expand Down
1 change: 0 additions & 1 deletion development/states/send-edit.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"send": {
"gasLimit": "0xea60",
"gasPrice": "0xba43b7400",
Expand Down
1 change: 0 additions & 1 deletion development/states/send-new-ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"send": {
"gasLimit": null,
"gasPrice": null,
Expand Down
1 change: 0 additions & 1 deletion development/states/send.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"type": "testnet"
},
"shapeShiftTxList": [],
"lostAccounts": [],
"frequentRpcListDetail": []
},
"appState": {
Expand Down
1 change: 0 additions & 1 deletion development/states/tx-list-items.json
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,6 @@
{"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}
],
"lostAccounts": [],
"send": {},
"currentLocale": "en",
"preferences": {
Expand Down
3 changes: 1 addition & 2 deletions test/data/2-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"noActiveNotices": true,
"shapeShiftTxList": [],
"infuraNetworkStatus": {},
"lostAccounts": [],
"seedWords": "debris dizzy just program just float decrease vacant alarm reduce speak stadium",
"forgottenPassword": null
}
}
8 changes: 0 additions & 8 deletions test/unit/app/controllers/metamask-controller-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
it('adds and sets forgottenPassword to config data to true', function () {
metamaskController.markPasswordForgotten(noop)
Expand Down
2 changes: 0 additions & 2 deletions ui/app/pages/home/home.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const mapStateToProps = state => {
const {
approvedOrigins,
dismissedOrigins,
lostAccounts,
suggestedTokens,
providerRequests,
migratedPrivacyMode,
Expand All @@ -42,7 +41,6 @@ const mapStateToProps = state => {
const isPopup = getEnvironmentType(window.location.href) === ENVIRONMENT_TYPE_POPUP

return {
lostAccounts,
forgottenPassword,
suggestedTokens,
unconfirmedTransactionsCount: unconfirmedTransactionsCountSelector(state),
Expand Down
1 change: 0 additions & 1 deletion ui/app/pages/send/tests/send-selectors-test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ module.exports = {
{ id: 'shapeShiftTx2', 'time': 1575000000000 },
{ id: 'shapeShiftTx3', 'time': 1475000000000 },
],
'lostAccounts': [],
'send': {
'gasLimit': '0xFFFF',
'gasPrice': '0xaa',
Expand Down
1 change: 0 additions & 1 deletion ui/app/selectors/tests/selectors-test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ module.exports = {
{ id: 'shapeShiftTx2', 'time': 1575000000000 },
{ id: 'shapeShiftTx3', 'time': 1475000000000 },
],
'lostAccounts': [],
'send': {
'gasLimit': '0xFFFF',
'gasPrice': '0xaa',
Expand Down
Loading