diff --git a/app/scripts/constants/sentry-state.ts b/app/scripts/constants/sentry-state.ts index f18fb96d85fd..9823b2ada540 100644 --- a/app/scripts/constants/sentry-state.ts +++ b/app/scripts/constants/sentry-state.ts @@ -90,7 +90,6 @@ export const SENTRY_BACKGROUND_STATE = { termsOfUseLastAgreed: true, timeoutMinutes: true, trezorModel: true, - usedNetworks: true, }, MultichainBalancesController: { balances: false, diff --git a/app/scripts/controllers/app-state-controller.test.ts b/app/scripts/controllers/app-state-controller.test.ts index 4bc1cb63e390..f830e0ee1cdf 100644 --- a/app/scripts/controllers/app-state-controller.test.ts +++ b/app/scripts/controllers/app-state-controller.test.ts @@ -374,17 +374,6 @@ describe('AppStateController', () => { }); }); - describe('setFirstTimeUsedNetwork', () => { - it('updates the array of the first time used networks', () => { - const chainId = '0x1'; - - appStateController.setFirstTimeUsedNetwork(chainId); - expect(appStateController.store.getState().usedNetworks[chainId]).toBe( - true, - ); - }); - }); - describe('setLastInteractedConfirmationInfo', () => { it('sets information about last confirmation user has interacted with', () => { const lastInteractedConfirmationInfo = { diff --git a/app/scripts/controllers/app-state-controller.ts b/app/scripts/controllers/app-state-controller.ts index 605f307ec0e4..c506dc329e94 100644 --- a/app/scripts/controllers/app-state-controller.ts +++ b/app/scripts/controllers/app-state-controller.ts @@ -62,7 +62,6 @@ export type AppStateControllerState = { hadAdvancedGasFeesSetPriorToMigration92_3: boolean; qrHardware: Json; nftsDropdownState: Json; - usedNetworks: Record; surveyLinkLastClickedOrClosed: number | null; signatureSecurityAlertResponses: Record; // States used for displaying the changed network toast @@ -138,7 +137,6 @@ type AppStateControllerInitState = Partial< AppStateControllerState, | 'qrHardware' | 'nftsDropdownState' - | 'usedNetworks' | 'surveyLinkLastClickedOrClosed' | 'signatureSecurityAlertResponses' | 'switchedNetworkDetails' @@ -184,11 +182,6 @@ const getDefaultAppStateControllerState = ( ...initState, qrHardware: {}, nftsDropdownState: {}, - usedNetworks: { - '0x1': true, - '0x5': true, - '0x539': true, - }, surveyLinkLastClickedOrClosed: null, signatureSecurityAlertResponses: {}, switchedNetworkDetails: null, @@ -704,19 +697,6 @@ export class AppStateController extends EventEmitter { }); } - /** - * Updates the array of the first time used networks - * - * @param chainId - */ - setFirstTimeUsedNetwork(chainId: string): void { - const currentState = this.store.getState(); - const { usedNetworks } = currentState; - usedNetworks[chainId] = true; - - this.store.updateState({ usedNetworks }); - } - ///: BEGIN:ONLY_INCLUDE_IF(build-mmi) /** * Set the interactive replacement token with a url and the old refresh token diff --git a/test/data/mock-send-state.json b/test/data/mock-send-state.json index 73468aca6171..f9c602808719 100644 --- a/test/data/mock-send-state.json +++ b/test/data/mock-send-state.json @@ -140,11 +140,6 @@ "isAccountMenuOpen": false, "isUnlocked": true, "completedOnboarding": true, - "usedNetworks": { - "0x1": true, - "0x5": true, - "0x539": true - }, "showTestnetMessageInDropdown": true, "alertEnabledness": { "unconnectedAccount": true diff --git a/test/e2e/default-fixture.js b/test/e2e/default-fixture.js index c2fba9d63424..a6845e40ec4c 100644 --- a/test/e2e/default-fixture.js +++ b/test/e2e/default-fixture.js @@ -115,12 +115,6 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) { trezorModel: null, newPrivacyPolicyToastClickedOrClosed: true, newPrivacyPolicyToastShownDate: Date.now(), - usedNetworks: { - [CHAIN_IDS.MAINNET]: true, - [CHAIN_IDS.LINEA_MAINNET]: true, - [CHAIN_IDS.GOERLI]: true, - [CHAIN_IDS.LOCALHOST]: true, - }, snapsInstallPrivacyWarningShown: true, }, BridgeController: { diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index 844c4766db3e..94e515d46ff6 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -40,12 +40,6 @@ function onboardingFixture() { '__FIXTURE_SUBSTITUTION__currentDateInMilliseconds', showTestnetMessageInDropdown: true, trezorModel: null, - usedNetworks: { - [CHAIN_IDS.MAINNET]: true, - [CHAIN_IDS.LINEA_MAINNET]: true, - [CHAIN_IDS.GOERLI]: true, - [CHAIN_IDS.LOCALHOST]: true, - }, }, NetworkController: { ...mockNetworkStateOld({ diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json index 1df430082f3e..8351032761a7 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json @@ -45,7 +45,6 @@ "nftsDropdownState": {}, "termsOfUseLastAgreed": "number", "qrHardware": {}, - "usedNetworks": { "0x1": true, "0x5": true, "0x539": true }, "snapsInstallPrivacyWarningShown": true, "surveyLinkLastClickedOrClosed": "object", "signatureSecurityAlertResponses": "object", diff --git a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json index 9988234cac2e..5d79ca5964b8 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json @@ -95,7 +95,6 @@ "nftsDropdownState": {}, "termsOfUseLastAgreed": "number", "qrHardware": {}, - "usedNetworks": { "0x1": true, "0x5": true, "0x539": true }, "snapsInstallPrivacyWarningShown": true, "surveyLinkLastClickedOrClosed": "object", "signatureSecurityAlertResponses": "object", diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json index 07b292d33b3b..1a1009c02c23 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-background-state.json @@ -42,12 +42,6 @@ "trezorModel": null, "newPrivacyPolicyToastClickedOrClosed": "boolean", "newPrivacyPolicyToastShownDate": "number", - "usedNetworks": { - "0x1": true, - "0xe708": true, - "0x5": true, - "0x539": true - }, "snapsInstallPrivacyWarningShown": true }, "CurrencyController": { diff --git a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json index f997b89bcd28..e7fe6fd2a641 100644 --- a/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json +++ b/test/e2e/tests/metrics/state-snapshots/errors-before-init-opt-in-ui-state.json @@ -42,12 +42,6 @@ "trezorModel": null, "newPrivacyPolicyToastClickedOrClosed": "boolean", "newPrivacyPolicyToastShownDate": "number", - "usedNetworks": { - "0x1": true, - "0xe708": true, - "0x5": true, - "0x539": true - }, "snapsInstallPrivacyWarningShown": true }, "BridgeController": { diff --git a/test/integration/data/integration-init-state.json b/test/integration/data/integration-init-state.json index 0c3853035080..ac58306adca8 100644 --- a/test/integration/data/integration-init-state.json +++ b/test/integration/data/integration-init-state.json @@ -2052,15 +2052,6 @@ "useSafeChainsListValidation": true, "useTokenDetection": false, "useTransactionSimulations": true, - "usedNetworks": { - "0xaa36a7": { - "rpcUrl": "https://sepolia.infura.io/v3/dummy_key", - "chainId": "0xaa36a7", - "nickname": "Sepolia Test Network", - "ticker": "ETH", - "blockExplorerUrl": "https://sepolia.etherscan.io" - } - }, "userOperations": {}, "versionFileETag": "W/\"598946a37f16c5b882a0bebbadf4509f\"", "versionInfo": [], diff --git a/test/integration/data/onboarding-completion-route.json b/test/integration/data/onboarding-completion-route.json index b2c19536a138..33d0680ab8a0 100644 --- a/test/integration/data/onboarding-completion-route.json +++ b/test/integration/data/onboarding-completion-route.json @@ -463,7 +463,6 @@ "useSafeChainsListValidation": true, "useTokenDetection": true, "useTransactionSimulations": true, - "usedNetworks": { "0x1": true, "0x5": true, "0x539": true }, "userOperations": {}, "versionFileETag": "", "versionInfo": [], diff --git a/ui/pages/routes/routes.component.test.js b/ui/pages/routes/routes.component.test.js index 14490ad6e146..e661099e1aa2 100644 --- a/ui/pages/routes/routes.component.test.js +++ b/ui/pages/routes/routes.component.test.js @@ -225,12 +225,6 @@ describe('Routes Component', () => { }, selectedAccount: account.id, }, - usedNetworks: { - '0x1': true, - '0x5': true, - '0x539': true, - [mockNewlyAddedNetwork.chainId]: false, - }, networkConfigurationsByChainId: { ...mockState.metamask.networkConfigurationsByChainId, [mockNewlyAddedNetwork.chainId]: mockNewlyAddedNetwork, @@ -312,7 +306,6 @@ describe('toast display', () => { announcements: {}, approvalFlows: [], completedOnboarding: true, - usedNetworks: [], pendingApprovals: {}, pendingApprovalCount: 0, preferences: { @@ -341,7 +334,6 @@ describe('toast display', () => { announcements: {}, approvalFlows: [], completedOnboarding: true, - usedNetworks: [], pendingApprovals: {}, pendingApprovalCount: 0, swapsState: { swapsFeatureIsLive: true }, diff --git a/ui/pages/routes/routes.container.js b/ui/pages/routes/routes.container.js index 28f4291ee37c..0342fc2e15d1 100644 --- a/ui/pages/routes/routes.container.js +++ b/ui/pages/routes/routes.container.js @@ -8,7 +8,6 @@ import { } from '../../../shared/modules/selectors/networks'; import { getAllAccountsOnNetworkAreEmpty, - getIsNetworkUsed, getNetworkIdentifier, getPreferences, getTheme, @@ -95,7 +94,6 @@ function mapStateToProps(state) { providerType: getProviderConfig(state).type, theme: getTheme(state), sendStage: getSendStage(state), - isNetworkUsed: getIsNetworkUsed(state), allAccountsOnNetworkAreEmpty: getAllAccountsOnNetworkAreEmpty(state), isTestNet: getIsTestnet(state), showExtensionInFullSizeView: getShowExtensionInFullSizeView(state), diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index 2baaa1a0c931..deb18c1c5309 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -2726,13 +2726,6 @@ export function getBlockExplorerLinkText( return blockExplorerLinkText; } -export function getIsNetworkUsed(state) { - const chainId = getCurrentChainId(state); - const { usedNetworks } = state.metamask; - - return Boolean(usedNetworks[chainId]); -} - export function getAllAccountsOnNetworkAreEmpty(state) { const balances = getMetaMaskCachedBalances(state) ?? {}; const hasNoNativeFundsOnAnyAccounts = Object.values(balances).every(