From b22b02c9c1e1f6b42d378187ee0a931a181789bc Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Mon, 18 Nov 2024 10:11:24 -0800 Subject: [PATCH 01/37] chore: Incorporate e2e fixes from PR 28450 --- .storybook/test-data.js | 1 + app/scripts/constants/sentry-state.ts | 1 + lavamoat/build-system/policy.json | 10 +++++++++- test/e2e/default-fixture.js | 1 + test/e2e/fixture-builder.js | 3 +++ .../errors-after-init-opt-in-background-state.json | 8 +++++++- .../errors-after-init-opt-in-ui-state.json | 8 +++++++- ...errors-before-init-opt-in-background-state.json | 1 + .../errors-before-init-opt-in-ui-state.json | 1 + test/e2e/tests/privacy-mode/privacy-mode.spec.js | 10 +++++----- test/e2e/tests/tokens/token-sort.spec.ts | 14 ++++---------- test/jest/mock-store.js | 1 + .../asset-list-control-bar.tsx | 9 +++++---- .../asset-list/network-filter/network-filter.tsx | 10 +++++----- .../multichain/token-list-item/token-list-item.tsx | 10 ++-------- 15 files changed, 53 insertions(+), 35 deletions(-) diff --git a/.storybook/test-data.js b/.storybook/test-data.js index 13006e5d1ff7..4ef6de0a689c 100644 --- a/.storybook/test-data.js +++ b/.storybook/test-data.js @@ -682,6 +682,7 @@ const state = { order: 'dsc', sortCallback: 'stringNumeric', }, + tokenNetworkFilter: {}, }, incomingTransactionsPreferences: { [CHAIN_IDS.MAINNET]: true, diff --git a/app/scripts/constants/sentry-state.ts b/app/scripts/constants/sentry-state.ts index 5146e38e8a41..f8bf83db88b2 100644 --- a/app/scripts/constants/sentry-state.ts +++ b/app/scripts/constants/sentry-state.ts @@ -245,6 +245,7 @@ export const SENTRY_BACKGROUND_STATE = { showFiatInTestnets: true, showTestNetworks: true, smartTransactionsOptInStatus: true, + tokenNetworkFilter: {}, showNativeTokenAsMainBalance: true, petnamesEnabled: true, showConfirmationAdvancedDetails: true, diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index 1cadff4100d7..bdbc36f6819b 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -2040,7 +2040,8 @@ "chokidar>normalize-path": true, "chokidar>readdirp": true, "del>is-glob": true, - "eslint>glob-parent": true + "eslint>glob-parent": true, + "tsx>fsevents": true } }, "chokidar>anymatch": { @@ -8767,6 +8768,13 @@ "typescript": true } }, + "tsx>fsevents": { + "globals": { + "console.assert": true, + "process.platform": true + }, + "native": true + }, "typescript": { "builtin": { "buffer.Buffer": true, diff --git a/test/e2e/default-fixture.js b/test/e2e/default-fixture.js index fd2d5be42891..704bd7332ad8 100644 --- a/test/e2e/default-fixture.js +++ b/test/e2e/default-fixture.js @@ -224,6 +224,7 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) { order: 'dsc', sortCallback: 'stringNumeric', }, + tokenNetworkFilter: {}, shouldShowAggregatedBalancePopover: true, }, selectedAddress: '0x5cfe73b6021e818b776b421b1c4db2474086a7e1', diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index bea9e9bad77f..844c4766db3e 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -89,6 +89,7 @@ function onboardingFixture() { order: 'dsc', sortCallback: 'stringNumeric', }, + tokenNetworkFilter: {}, shouldShowAggregatedBalancePopover: true, }, useExternalServices: true, @@ -126,6 +127,7 @@ function onboardingFixture() { }, showTestNetworks: false, smartTransactionsOptInStatus: true, + tokenNetworkFilter: {}, }, QueuedRequestController: { queuedRequestCount: 0, @@ -664,6 +666,7 @@ class FixtureBuilder { return this.withPreferencesController({ preferences: { smartTransactionsOptInStatus: true, + tokenNetworkFilter: {}, }, }); } 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 e47cfcd806b9..c2fe3288fdc2 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 @@ -237,6 +237,13 @@ "redesignedConfirmationsEnabled": true, "redesignedTransactionsEnabled": "boolean", "tokenSortConfig": "object", + "tokenNetworkFilter": { + "0x1": "boolean", + "0xaa36a7": "boolean", + "0xe705": "boolean", + "0xe708": "boolean", + "0x539": "boolean" + }, "shouldShowAggregatedBalancePopover": "boolean" }, "ipfsGateway": "string", @@ -339,7 +346,6 @@ }, "TxController": { "methodData": "object", - "submitHistory": "object", "transactions": "object", "lastFetchedBlockNumbers": "object", "submitHistory": "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 7fd8501eb2b8..6d0dc5cbc54d 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 @@ -38,7 +38,13 @@ "redesignedConfirmationsEnabled": true, "redesignedTransactionsEnabled": "boolean", "tokenSortConfig": "object", - "showMultiRpcModal": "boolean", + "tokenNetworkFilter": { + "0x1": "boolean", + "0xaa36a7": "boolean", + "0xe705": "boolean", + "0xe708": "boolean", + "0x539": "boolean" + }, "shouldShowAggregatedBalancePopover": "boolean" }, "firstTimeFlowType": "import", 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 fa1a00cbe4ef..07b292d33b3b 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 @@ -118,6 +118,7 @@ "isRedesignedConfirmationsDeveloperEnabled": "boolean", "showConfirmationAdvancedDetails": false, "tokenSortConfig": "object", + "tokenNetworkFilter": {}, "showMultiRpcModal": "boolean", "shouldShowAggregatedBalancePopover": "boolean" }, 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 b3fa8d117beb..f997b89bcd28 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 @@ -135,6 +135,7 @@ "isRedesignedConfirmationsDeveloperEnabled": "boolean", "showConfirmationAdvancedDetails": false, "tokenSortConfig": "object", + "tokenNetworkFilter": {}, "showMultiRpcModal": "boolean", "shouldShowAggregatedBalancePopover": "boolean" }, diff --git a/test/e2e/tests/privacy-mode/privacy-mode.spec.js b/test/e2e/tests/privacy-mode/privacy-mode.spec.js index a4d2c2245752..ede37f900e66 100644 --- a/test/e2e/tests/privacy-mode/privacy-mode.spec.js +++ b/test/e2e/tests/privacy-mode/privacy-mode.spec.js @@ -18,7 +18,7 @@ describe('Privacy Mode', function () { async ({ driver }) => { async function checkForHeaderValue(value) { const balanceElement = await driver.findElement( - '[data-testid="eth-overview__primary-currency"] .currency-display-component__text', + '[data-testid="account-value-and-suffix"]', ); const surveyText = await balanceElement.getText(); assert.equal( @@ -30,7 +30,7 @@ describe('Privacy Mode', function () { async function checkForTokenValue(value) { const balanceElement = await driver.findElement( - '[data-testid="multichain-token-list-item-secondary-value"]', + '[data-testid="multichain-token-list-item-value"]', ); const surveyText = await balanceElement.getText(); assert.equal(surveyText, value, `Token balance should be "${value}"`); @@ -38,7 +38,7 @@ describe('Privacy Mode', function () { async function checkForPrivacy() { await checkForHeaderValue('••••••'); - await checkForTokenValue('•••••••••'); + await checkForTokenValue('••••••'); } async function checkForNoPrivacy() { @@ -48,7 +48,7 @@ describe('Privacy Mode', function () { async function togglePrivacy() { const balanceElement = await driver.findElement( - '[data-testid="eth-overview__primary-currency"] .currency-display-component__text', + '[data-testid="account-value-and-suffix"]', ); const initialText = await balanceElement.getText(); @@ -81,7 +81,7 @@ describe('Privacy Mode', function () { async function togglePrivacy() { const balanceElement = await driver.findElement( - '[data-testid="eth-overview__primary-currency"] .currency-display-component__text', + '[data-testid="account-value-and-suffix"]', ); const initialText = await balanceElement.getText(); diff --git a/test/e2e/tests/tokens/token-sort.spec.ts b/test/e2e/tests/tokens/token-sort.spec.ts index 1fc1df7efd2c..c7611a3b10ba 100644 --- a/test/e2e/tests/tokens/token-sort.spec.ts +++ b/test/e2e/tests/tokens/token-sort.spec.ts @@ -65,10 +65,8 @@ describe('Token List', function () { assert.ok(tokenSymbolsBeforeSorting[0].includes('Ethereum')); - await await driver.clickElement( - '[data-testid="sort-by-popover-toggle"]', - ); - await await driver.clickElement('[data-testid="sortByAlphabetically"]'); + await driver.clickElement('[data-testid="sort-by-popover-toggle"]'); + await driver.clickElement('[data-testid="sortByAlphabetically"]'); await driver.delay(regularDelayMs); const tokenListAfterSortingAlphabetically = await driver.findElements( @@ -84,12 +82,8 @@ describe('Token List', function () { tokenListSymbolsAfterSortingAlphabetically[0].includes('ABC'), ); - await await driver.clickElement( - '[data-testid="sort-by-popover-toggle"]', - ); - await await driver.clickElement( - '[data-testid="sortByDecliningBalance"]', - ); + await driver.clickElement('[data-testid="sort-by-popover-toggle"]'); + await driver.clickElement('[data-testid="sortByDecliningBalance"]'); await driver.delay(regularDelayMs); const tokenListBeforeSortingByDecliningBalance = diff --git a/test/jest/mock-store.js b/test/jest/mock-store.js index 3fe524634075..4720bf427372 100644 --- a/test/jest/mock-store.js +++ b/test/jest/mock-store.js @@ -139,6 +139,7 @@ export const createSwapsMockStore = () => { preferences: { showFiatInTestnets: true, smartTransactionsOptInStatus: true, + tokenNetworkFilter: {}, showMultiRpcModal: false, }, transactions: [ diff --git a/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx b/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx index 5b1c00db8025..aef1cfa380cf 100644 --- a/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx +++ b/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx @@ -50,18 +50,19 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => { useState(false); const allOpts: Record = {}; - Object.keys(allNetworks).forEach((chainId) => { + Object.keys(allNetworks || {}).forEach((chainId) => { allOpts[chainId] = true; }); const allNetworksFilterShown = - Object.keys(tokenNetworkFilter).length !== Object.keys(allOpts).length; + Object.keys(tokenNetworkFilter || {}).length !== + Object.keys(allOpts || {}).length; // TODO: This useEffect should be a migration // We need to set the default filter for all users to be all included networks, rather than defaulting to empty object // This effect is to unblock and derisk in the short-term useEffect(() => { - if (Object.keys(tokenNetworkFilter).length === 0) { + if (Object.keys(tokenNetworkFilter || {}).length === 0) { dispatch(setTokenNetworkFilter(allOpts)); } }, []); @@ -101,7 +102,7 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => { > {process.env.PORTFOLIO_VIEW && ( { useEffect(() => { const testnetChains: string[] = TEST_CHAINS; - const mainnetChainIds = Object.keys(allNetworks).filter( + const mainnetChainIds = Object.keys(allNetworks || {}).filter( (chain) => !testnetChains.includes(chain), ); setChainsToShow(mainnetChainIds); }, []); const allOpts: Record = {}; - Object.keys(allNetworks).forEach((chain) => { + Object.keys(allNetworks || {}).forEach((chain) => { allOpts[chain] = true; }); @@ -71,8 +71,8 @@ const NetworkFilter = ({ handleClose }: SortControlProps) => { <> handleFilter(allOpts)} testId="network-filter-all" @@ -125,7 +125,7 @@ const NetworkFilter = ({ handleClose }: SortControlProps) => { handleFilter({ [chainId]: true })} testId="network-filter-current" diff --git a/ui/components/multichain/token-list-item/token-list-item.tsx b/ui/components/multichain/token-list-item/token-list-item.tsx index da8468a82209..540d2d8be98a 100644 --- a/ui/components/multichain/token-list-item/token-list-item.tsx +++ b/ui/components/multichain/token-list-item/token-list-item.tsx @@ -389,10 +389,7 @@ export const TokenListItem = ({ isHidden={privacyMode} length={SensitiveTextLength.Short} > - {primary}{' '} - {isNativeCurrency || isPrimaryTokenSymbolHidden - ? '' - : tokenSymbol} + {primary} {isPrimaryTokenSymbolHidden ? '' : tokenSymbol} ) : ( @@ -422,10 +419,7 @@ export const TokenListItem = ({ isHidden={privacyMode} length={SensitiveTextLength.Short} > - {primary}{' '} - {isNativeCurrency || isPrimaryTokenSymbolHidden - ? '' - : tokenSymbol} + {primary} {isPrimaryTokenSymbolHidden ? '' : tokenSymbol} )} From 8db4d72d607142d943ba5a82a62737b6d39b2201 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Mon, 18 Nov 2024 10:18:50 -0800 Subject: [PATCH 02/37] fix: Bump vulnerable package cross-spawn to 7.0.5 --- package.json | 2 +- yarn.lock | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 09bb90863a00..063cbb14ee86 100644 --- a/package.json +++ b/package.json @@ -561,7 +561,7 @@ "concurrently": "^8.2.2", "copy-webpack-plugin": "^12.0.2", "core-js-pure": "^3.38.0", - "cross-spawn": "^7.0.3", + "cross-spawn": "^7.0.5", "crypto-browserify": "^3.12.0", "css-loader": "^6.10.0", "css-to-xpath": "^0.1.0", diff --git a/yarn.lock b/yarn.lock index 4602bb34f62f..16835bcbd3ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16184,6 +16184,17 @@ __metadata: languageName: node linkType: hard +"cross-spawn@npm:^7.0.5": + version: 7.0.6 + resolution: "cross-spawn@npm:7.0.6" + dependencies: + path-key: "npm:^3.1.0" + shebang-command: "npm:^2.0.0" + which: "npm:^2.0.1" + checksum: 10/0d52657d7ae36eb130999dffff1168ec348687b48dd38e2ff59992ed916c88d328cf1d07ff4a4a10bc78de5e1c23f04b306d569e42f7a2293915c081e4dfee86 + languageName: node + linkType: hard + "crypt@npm:0.0.2": version: 0.0.2 resolution: "crypt@npm:0.0.2" @@ -26927,7 +26938,7 @@ __metadata: copy-to-clipboard: "npm:^3.3.3" copy-webpack-plugin: "npm:^12.0.2" core-js-pure: "npm:^3.38.0" - cross-spawn: "npm:^7.0.3" + cross-spawn: "npm:^7.0.5" crypto-browserify: "npm:^3.12.0" css-loader: "npm:^6.10.0" css-to-xpath: "npm:^0.1.0" From 8fe3abfbbefcc9ac3b92f335d6a797e623c3f2b1 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Mon, 18 Nov 2024 10:30:18 -0800 Subject: [PATCH 03/37] fix: Update policy --- lavamoat/build-system/policy.json | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index bdbc36f6819b..27b5f1330d11 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -1163,6 +1163,21 @@ "crypto": true } }, + "@sentry/cli>which": { + "builtin": { + "path.join": true + }, + "globals": { + "process.cwd": true, + "process.env.OSTYPE": true, + "process.env.PATH": true, + "process.env.PATHEXT": true, + "process.platform": true + }, + "packages": { + "@sentry/cli>which>isexe": true + } + }, "@sentry/cli>which>isexe": { "builtin": { "fs": true @@ -2130,9 +2145,9 @@ "process.platform": true }, "packages": { + "@sentry/cli>which": true, "cross-spawn>path-key": true, - "cross-spawn>shebang-command": true, - "cross-spawn>which": true + "cross-spawn>shebang-command": true } }, "cross-spawn>path-key": { @@ -2146,21 +2161,6 @@ "cross-spawn>shebang-command>shebang-regex": true } }, - "cross-spawn>which": { - "builtin": { - "path.join": true - }, - "globals": { - "process.cwd": true, - "process.env.OSTYPE": true, - "process.env.PATH": true, - "process.env.PATHEXT": true, - "process.platform": true - }, - "packages": { - "@sentry/cli>which>isexe": true - } - }, "debounce-stream>duplexer": { "builtin": { "stream": true From aaa978abe3ef03deeb4344e76c9cf70ab18a3a36 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Mon, 18 Nov 2024 10:41:13 -0800 Subject: [PATCH 04/37] chore: Dedupe startPolling methods in metamask-controller --- app/scripts/metamask-controller.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 52390f64f551..a175ee51be97 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -4061,14 +4061,6 @@ export default class MetamaskController extends EventEmitter { tokenRatesController, ), - tokenBalancesStartPolling: tokenBalancesController.startPolling.bind( - tokenBalancesController, - ), - tokenBalancesStopPollingByPollingToken: - tokenBalancesController.stopPollingByPollingToken.bind( - tokenBalancesController, - ), - tokenDetectionStartPolling: tokenDetectionController.startPolling.bind( tokenDetectionController, ), From bc72f5e0736ffa853d3ab28a34ab13ad4741a5f3 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Mon, 18 Nov 2024 10:49:35 -0800 Subject: [PATCH 05/37] fix: deduplicate --- yarn.lock | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index 16835bcbd3ed..910fe0a3dda5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16173,18 +16173,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": - version: 7.0.3 - resolution: "cross-spawn@npm:7.0.3" - dependencies: - path-key: "npm:^3.1.0" - shebang-command: "npm:^2.0.0" - which: "npm:^2.0.1" - checksum: 10/e1a13869d2f57d974de0d9ef7acbf69dc6937db20b918525a01dacb5032129bd552d290d886d981e99f1b624cb03657084cc87bd40f115c07ecf376821c729ce - languageName: node - linkType: hard - -"cross-spawn@npm:^7.0.5": +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.5": version: 7.0.6 resolution: "cross-spawn@npm:7.0.6" dependencies: From 60e94a78bea05d20cb6529a19d7baa2f12473ade Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Mon, 18 Nov 2024 10:54:25 -0800 Subject: [PATCH 06/37] fix: Another attempt at cross-spawn upgrade --- package.json | 3 ++- yarn.lock | 55 ++-------------------------------------------------- 2 files changed, 4 insertions(+), 54 deletions(-) diff --git a/package.json b/package.json index 063cbb14ee86..42938bdd1e90 100644 --- a/package.json +++ b/package.json @@ -257,7 +257,8 @@ "@ledgerhq/evm-tools/axios": "^0.28.0", "@ledgerhq/hw-app-eth/axios": "^0.28.0", "@ledgerhq/hw-app-eth@npm:^6.39.0": "patch:@ledgerhq/hw-app-eth@npm%3A6.39.0#~/.yarn/patches/@ledgerhq-hw-app-eth-npm-6.39.0-866309bbbe.patch", - "@ledgerhq/evm-tools@npm:^1.2.3": "patch:@ledgerhq/evm-tools@npm%3A1.2.3#~/.yarn/patches/@ledgerhq-evm-tools-npm-1.2.3-414f44baa9.patch" + "@ledgerhq/evm-tools@npm:^1.2.3": "patch:@ledgerhq/evm-tools@npm%3A1.2.3#~/.yarn/patches/@ledgerhq-evm-tools-npm-1.2.3-414f44baa9.patch", + "cross-spawn": "^7.0.5" }, "dependencies": { "@babel/runtime": "patch:@babel/runtime@npm%3A7.25.9#~/.yarn/patches/@babel-runtime-npm-7.25.9-fe8c62510a.patch", diff --git a/yarn.lock b/yarn.lock index 910fe0a3dda5..9d25f75bf0be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16162,18 +16162,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^5.0.1": - version: 5.1.0 - resolution: "cross-spawn@npm:5.1.0" - dependencies: - lru-cache: "npm:^4.0.1" - shebang-command: "npm:^1.2.0" - which: "npm:^1.2.9" - checksum: 10/726939c9954fc70c20e538923feaaa33bebc253247d13021737c3c7f68cdc3e0a57f720c0fe75057c0387995349f3f12e20e9bfdbf12274db28019c7ea4ec166 - languageName: node - linkType: hard - -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.5": +"cross-spawn@npm:^7.0.5": version: 7.0.6 resolution: "cross-spawn@npm:7.0.6" dependencies: @@ -26031,16 +26020,6 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^4.0.1": - version: 4.1.1 - resolution: "lru-cache@npm:4.1.1" - dependencies: - pseudomap: "npm:^1.0.2" - yallist: "npm:^2.1.2" - checksum: 10/a412db13e89abe202c2314e633bd8580be2a668ba2036c34da376ac66163aa9fba4727ca66ff7907ad68fb574511f0bc6275c0598fdaeeab92e1125f5397d0e4 - languageName: node - linkType: hard - "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -30655,13 +30634,6 @@ __metadata: languageName: node linkType: hard -"pseudomap@npm:^1.0.2": - version: 1.0.2 - resolution: "pseudomap@npm:1.0.2" - checksum: 10/856c0aae0ff2ad60881168334448e898ad7a0e45fe7386d114b150084254c01e200c957cf378378025df4e052c7890c5bd933939b0e0d2ecfcc1dc2f0b2991f5 - languageName: node - linkType: hard - "psl@npm:^1.1.33": version: 1.9.0 resolution: "psl@npm:1.9.0" @@ -33737,15 +33709,6 @@ __metadata: languageName: node linkType: hard -"shebang-command@npm:^1.2.0": - version: 1.2.0 - resolution: "shebang-command@npm:1.2.0" - dependencies: - shebang-regex: "npm:^1.0.0" - checksum: 10/9eed1750301e622961ba5d588af2212505e96770ec376a37ab678f965795e995ade7ed44910f5d3d3cb5e10165a1847f52d3348c64e146b8be922f7707958908 - languageName: node - linkType: hard - "shebang-command@npm:^2.0.0": version: 2.0.0 resolution: "shebang-command@npm:2.0.0" @@ -33755,13 +33718,6 @@ __metadata: languageName: node linkType: hard -"shebang-regex@npm:^1.0.0": - version: 1.0.0 - resolution: "shebang-regex@npm:1.0.0" - checksum: 10/404c5a752cd40f94591dfd9346da40a735a05139dac890ffc229afba610854d8799aaa52f87f7e0c94c5007f2c6af55bdcaeb584b56691926c5eaf41dc8f1372 - languageName: node - linkType: hard - "shebang-regex@npm:^3.0.0": version: 3.0.0 resolution: "shebang-regex@npm:3.0.0" @@ -37911,7 +37867,7 @@ __metadata: languageName: node linkType: hard -"which@npm:^1.2.12, which@npm:^1.2.14, which@npm:^1.2.9, which@npm:^1.3.1": +"which@npm:^1.2.12, which@npm:^1.2.14, which@npm:^1.3.1": version: 1.3.1 resolution: "which@npm:1.3.1" dependencies: @@ -38245,13 +38201,6 @@ __metadata: languageName: node linkType: hard -"yallist@npm:^2.1.2": - version: 2.1.2 - resolution: "yallist@npm:2.1.2" - checksum: 10/75fc7bee4821f52d1c6e6021b91b3e079276f1a9ce0ad58da3c76b79a7e47d6f276d35e206a96ac16c1cf48daee38a8bb3af0b1522a3d11c8ffe18f898828832 - languageName: node - linkType: hard - "yallist@npm:^3.0.2": version: 3.1.1 resolution: "yallist@npm:3.1.1" From b62fcda7499abff4284e05d935bda24ed9e9a28e Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Mon, 18 Nov 2024 11:09:52 -0800 Subject: [PATCH 07/37] fix: Downgrade cross-spawn version --- lavamoat/build-system/policy.json | 34 +++++++++--------- package.json | 5 ++- yarn.lock | 57 +++++++++++++++++++++++++++++-- 3 files changed, 73 insertions(+), 23 deletions(-) diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index 27b5f1330d11..bdbc36f6819b 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -1163,21 +1163,6 @@ "crypto": true } }, - "@sentry/cli>which": { - "builtin": { - "path.join": true - }, - "globals": { - "process.cwd": true, - "process.env.OSTYPE": true, - "process.env.PATH": true, - "process.env.PATHEXT": true, - "process.platform": true - }, - "packages": { - "@sentry/cli>which>isexe": true - } - }, "@sentry/cli>which>isexe": { "builtin": { "fs": true @@ -2145,9 +2130,9 @@ "process.platform": true }, "packages": { - "@sentry/cli>which": true, "cross-spawn>path-key": true, - "cross-spawn>shebang-command": true + "cross-spawn>shebang-command": true, + "cross-spawn>which": true } }, "cross-spawn>path-key": { @@ -2161,6 +2146,21 @@ "cross-spawn>shebang-command>shebang-regex": true } }, + "cross-spawn>which": { + "builtin": { + "path.join": true + }, + "globals": { + "process.cwd": true, + "process.env.OSTYPE": true, + "process.env.PATH": true, + "process.env.PATHEXT": true, + "process.platform": true + }, + "packages": { + "@sentry/cli>which>isexe": true + } + }, "debounce-stream>duplexer": { "builtin": { "stream": true diff --git a/package.json b/package.json index 42938bdd1e90..09bb90863a00 100644 --- a/package.json +++ b/package.json @@ -257,8 +257,7 @@ "@ledgerhq/evm-tools/axios": "^0.28.0", "@ledgerhq/hw-app-eth/axios": "^0.28.0", "@ledgerhq/hw-app-eth@npm:^6.39.0": "patch:@ledgerhq/hw-app-eth@npm%3A6.39.0#~/.yarn/patches/@ledgerhq-hw-app-eth-npm-6.39.0-866309bbbe.patch", - "@ledgerhq/evm-tools@npm:^1.2.3": "patch:@ledgerhq/evm-tools@npm%3A1.2.3#~/.yarn/patches/@ledgerhq-evm-tools-npm-1.2.3-414f44baa9.patch", - "cross-spawn": "^7.0.5" + "@ledgerhq/evm-tools@npm:^1.2.3": "patch:@ledgerhq/evm-tools@npm%3A1.2.3#~/.yarn/patches/@ledgerhq-evm-tools-npm-1.2.3-414f44baa9.patch" }, "dependencies": { "@babel/runtime": "patch:@babel/runtime@npm%3A7.25.9#~/.yarn/patches/@babel-runtime-npm-7.25.9-fe8c62510a.patch", @@ -562,7 +561,7 @@ "concurrently": "^8.2.2", "copy-webpack-plugin": "^12.0.2", "core-js-pure": "^3.38.0", - "cross-spawn": "^7.0.5", + "cross-spawn": "^7.0.3", "crypto-browserify": "^3.12.0", "css-loader": "^6.10.0", "css-to-xpath": "^0.1.0", diff --git a/yarn.lock b/yarn.lock index 9d25f75bf0be..0b786c683342 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16162,7 +16162,18 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.5": +"cross-spawn@npm:^5.0.1": + version: 5.1.0 + resolution: "cross-spawn@npm:5.1.0" + dependencies: + lru-cache: "npm:^4.0.1" + shebang-command: "npm:^1.2.0" + which: "npm:^1.2.9" + checksum: 10/726939c9954fc70c20e538923feaaa33bebc253247d13021737c3c7f68cdc3e0a57f720c0fe75057c0387995349f3f12e20e9bfdbf12274db28019c7ea4ec166 + languageName: node + linkType: hard + +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.2, cross-spawn@npm:^7.0.3": version: 7.0.6 resolution: "cross-spawn@npm:7.0.6" dependencies: @@ -26020,6 +26031,16 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^4.0.1": + version: 4.1.5 + resolution: "lru-cache@npm:4.1.5" + dependencies: + pseudomap: "npm:^1.0.2" + yallist: "npm:^2.1.2" + checksum: 10/9ec7d73f11a32cba0e80b7a58fdf29970814c0c795acaee1a6451ddfd609bae6ef9df0837f5bbeabb571ecd49c1e2d79e10e9b4ed422cfba17a0cb6145b018a9 + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -26906,7 +26927,7 @@ __metadata: copy-to-clipboard: "npm:^3.3.3" copy-webpack-plugin: "npm:^12.0.2" core-js-pure: "npm:^3.38.0" - cross-spawn: "npm:^7.0.5" + cross-spawn: "npm:^7.0.3" crypto-browserify: "npm:^3.12.0" css-loader: "npm:^6.10.0" css-to-xpath: "npm:^0.1.0" @@ -30634,6 +30655,13 @@ __metadata: languageName: node linkType: hard +"pseudomap@npm:^1.0.2": + version: 1.0.2 + resolution: "pseudomap@npm:1.0.2" + checksum: 10/856c0aae0ff2ad60881168334448e898ad7a0e45fe7386d114b150084254c01e200c957cf378378025df4e052c7890c5bd933939b0e0d2ecfcc1dc2f0b2991f5 + languageName: node + linkType: hard + "psl@npm:^1.1.33": version: 1.9.0 resolution: "psl@npm:1.9.0" @@ -33709,6 +33737,15 @@ __metadata: languageName: node linkType: hard +"shebang-command@npm:^1.2.0": + version: 1.2.0 + resolution: "shebang-command@npm:1.2.0" + dependencies: + shebang-regex: "npm:^1.0.0" + checksum: 10/9eed1750301e622961ba5d588af2212505e96770ec376a37ab678f965795e995ade7ed44910f5d3d3cb5e10165a1847f52d3348c64e146b8be922f7707958908 + languageName: node + linkType: hard + "shebang-command@npm:^2.0.0": version: 2.0.0 resolution: "shebang-command@npm:2.0.0" @@ -33718,6 +33755,13 @@ __metadata: languageName: node linkType: hard +"shebang-regex@npm:^1.0.0": + version: 1.0.0 + resolution: "shebang-regex@npm:1.0.0" + checksum: 10/404c5a752cd40f94591dfd9346da40a735a05139dac890ffc229afba610854d8799aaa52f87f7e0c94c5007f2c6af55bdcaeb584b56691926c5eaf41dc8f1372 + languageName: node + linkType: hard + "shebang-regex@npm:^3.0.0": version: 3.0.0 resolution: "shebang-regex@npm:3.0.0" @@ -37867,7 +37911,7 @@ __metadata: languageName: node linkType: hard -"which@npm:^1.2.12, which@npm:^1.2.14, which@npm:^1.3.1": +"which@npm:^1.2.12, which@npm:^1.2.14, which@npm:^1.2.9, which@npm:^1.3.1": version: 1.3.1 resolution: "which@npm:1.3.1" dependencies: @@ -38201,6 +38245,13 @@ __metadata: languageName: node linkType: hard +"yallist@npm:^2.1.2": + version: 2.1.2 + resolution: "yallist@npm:2.1.2" + checksum: 10/75fc7bee4821f52d1c6e6021b91b3e079276f1a9ce0ad58da3c76b79a7e47d6f276d35e206a96ac16c1cf48daee38a8bb3af0b1522a3d11c8ffe18f898828832 + languageName: node + linkType: hard + "yallist@npm:^3.0.2": version: 3.1.1 resolution: "yallist@npm:3.1.1" From a4788759ca9fdf843c1eed082f0c092f15b583fc Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Mon, 18 Nov 2024 11:19:40 -0800 Subject: [PATCH 08/37] fix: Lint unused import in selectors.js --- ui/selectors/selectors.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index fdb56f02a152..0d2f86b92bea 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -86,7 +86,6 @@ import { getLedgerTransportType, isAddressLedger, getIsUnlocked, - getTokenBalances, } from '../ducks/metamask/metamask'; import { getLedgerWebHidConnectedStatus, From 17e88ba58b896f3c4b23402c460d5b1749ce4faa Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Mon, 18 Nov 2024 12:20:14 -0800 Subject: [PATCH 09/37] fix: Suffix e2e hack --- .../user-preferenced-currency-display.component.js | 2 +- ui/selectors/selectors.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js index abca2af153f0..7e0578bd5454 100644 --- a/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js +++ b/ui/components/app/user-preferenced-currency-display/user-preferenced-currency-display.component.js @@ -83,7 +83,7 @@ export default function UserPreferencedCurrencyDisplay({ data-testid={dataTestId} numberOfDecimals={numberOfDecimals} prefixComponent={prefixComponent} - hideLabel={!showCurrencySuffix} + // hideLabel={!showCurrencySuffix} suffix={showCurrencySuffix && !showEthLogo && currency} privacyMode={privacyMode} /> diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index 0d2f86b92bea..e4711c1b372a 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -490,7 +490,7 @@ export function getSelectedAccountTokensAcrossChains(state) { ...Object.keys(nativeTokenBalancesByChainId || {}), ]); - chainIds.forEach((chainId) => { + chainIds?.forEach((chainId) => { if (!tokensByChain[chainId]) { tokensByChain[chainId] = []; } From 3162038bf818e57e7094e3660fba7bfbad31bfbf Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Mon, 18 Nov 2024 12:36:41 -0800 Subject: [PATCH 10/37] chore: Update snapshots --- .../confirm-legacy-gas-display.test.js.snap | 7 +------ .../confirm-detail-row.component.test.js.snap | 14 ++------------ .../multi-layer-fee-message.test.js.snap | 14 ++------------ 3 files changed, 5 insertions(+), 30 deletions(-) diff --git a/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/__snapshots__/confirm-legacy-gas-display.test.js.snap b/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/__snapshots__/confirm-legacy-gas-display.test.js.snap index b555597e2e2a..db005f8c02e0 100644 --- a/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/__snapshots__/confirm-legacy-gas-display.test.js.snap +++ b/ui/pages/confirmations/components/confirm-gas-display/confirm-legacy-gas-display/__snapshots__/confirm-legacy-gas-display.test.js.snap @@ -47,7 +47,7 @@ exports[`ConfirmLegacyGasDisplay should match snapshot 1`] = `
0.000021 - - ETH -
diff --git a/ui/pages/confirmations/components/confirm-page-container/confirm-detail-row/__snapshots__/confirm-detail-row.component.test.js.snap b/ui/pages/confirmations/components/confirm-page-container/confirm-detail-row/__snapshots__/confirm-detail-row.component.test.js.snap index 68cefd7c395f..073d23aebf88 100644 --- a/ui/pages/confirmations/components/confirm-page-container/confirm-detail-row/__snapshots__/confirm-detail-row.component.test.js.snap +++ b/ui/pages/confirmations/components/confirm-page-container/confirm-detail-row/__snapshots__/confirm-detail-row.component.test.js.snap @@ -13,7 +13,7 @@ exports[`Confirm Detail Row Component should match snapshot 1`] = ` >
0 - - GoerliETH -
0 - - GoerliETH -
diff --git a/ui/pages/confirmations/components/multilayer-fee-message/__snapshots__/multi-layer-fee-message.test.js.snap b/ui/pages/confirmations/components/multilayer-fee-message/__snapshots__/multi-layer-fee-message.test.js.snap index 80da79578bdc..bf7516245e8b 100644 --- a/ui/pages/confirmations/components/multilayer-fee-message/__snapshots__/multi-layer-fee-message.test.js.snap +++ b/ui/pages/confirmations/components/multilayer-fee-message/__snapshots__/multi-layer-fee-message.test.js.snap @@ -101,7 +101,7 @@ exports[`Multi layer fee message when balance and token price checker is enabled >
$0.00 - - usd -
$0.56 - - usd -
Date: Mon, 18 Nov 2024 20:14:47 -0800 Subject: [PATCH 11/37] fix: Capizalize suffix in currency display --- ui/components/ui/currency-display/currency-display.component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/ui/currency-display/currency-display.component.js b/ui/components/ui/currency-display/currency-display.component.js index 7e2569ffaee3..c49ee47b6086 100644 --- a/ui/components/ui/currency-display/currency-display.component.js +++ b/ui/components/ui/currency-display/currency-display.component.js @@ -94,7 +94,7 @@ export default function CurrencyDisplay({ isHidden={privacyMode} {...suffixProps} > - {parts.suffix} + {parts.suffix.toUpperCase()} ) : null} From f280ff5363cea91232d62756f1db5175a8bb622a Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Mon, 18 Nov 2024 20:34:17 -0800 Subject: [PATCH 12/37] fix: Update expectation of capitalized currency suffix --- ui/components/app/wallet-overview/btc-overview.test.tsx | 2 +- .../multichain/account-list-item/account-list-item.test.js | 4 ++-- .../__snapshots__/asset-balance-text.test.tsx.snap | 2 +- .../templates/__snapshots__/remove-snap-account.test.js.snap | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/components/app/wallet-overview/btc-overview.test.tsx b/ui/components/app/wallet-overview/btc-overview.test.tsx index ee76d29feb39..5d16ca884125 100644 --- a/ui/components/app/wallet-overview/btc-overview.test.tsx +++ b/ui/components/app/wallet-overview/btc-overview.test.tsx @@ -180,7 +180,7 @@ describe('BtcOverview', () => { const primaryBalance = queryByTestId(BTC_OVERVIEW_PRIMARY_CURRENCY); expect(primaryBalance).toBeInTheDocument(); - expect(primaryBalance).toHaveTextContent(`$${mockNonEvmBalanceUsd}usd`); + expect(primaryBalance).toHaveTextContent(`$${mockNonEvmBalanceUsd}USD`); }); it('shows a spinner if balance is not available', async () => { diff --git a/ui/components/multichain/account-list-item/account-list-item.test.js b/ui/components/multichain/account-list-item/account-list-item.test.js index 87d1ce9cdfc5..69cd2ec4733e 100644 --- a/ui/components/multichain/account-list-item/account-list-item.test.js +++ b/ui/components/multichain/account-list-item/account-list-item.test.js @@ -272,7 +272,7 @@ describe('AccountListItem', () => { expect(firstCurrencyDisplay.firstChild.textContent).toContain( expectedBalance, ); - expect(firstCurrencyDisplay.lastChild.textContent).toContain('usd'); + expect(firstCurrencyDisplay.lastChild.textContent).toContain('USD'); expect(secondCurrencyDisplay.textContent).toContain(''); expect(avatarGroup).not.toBeInTheDocument(); }); @@ -307,7 +307,7 @@ describe('AccountListItem', () => { expect(firstCurrencyDisplay.firstChild.textContent).toContain( expectedBalance, ); - expect(firstCurrencyDisplay.lastChild.textContent).toContain('usd'); + expect(firstCurrencyDisplay.lastChild.textContent).toContain('USD'); expect(secondCurrencyDisplay).not.toBeInTheDocument(); expect(avatarGroup).toBeInTheDocument(); }); diff --git a/ui/components/multichain/asset-picker-amount/asset-balance/__snapshots__/asset-balance-text.test.tsx.snap b/ui/components/multichain/asset-picker-amount/asset-balance/__snapshots__/asset-balance-text.test.tsx.snap index a0c808186082..931310418d60 100644 --- a/ui/components/multichain/asset-picker-amount/asset-balance/__snapshots__/asset-balance-text.test.tsx.snap +++ b/ui/components/multichain/asset-picker-amount/asset-balance/__snapshots__/asset-balance-text.test.tsx.snap @@ -15,7 +15,7 @@ exports[`AssetBalanceText matches snapshot 1`] = ` - suffix + SUFFIX diff --git a/ui/pages/confirmations/confirmation/templates/__snapshots__/remove-snap-account.test.js.snap b/ui/pages/confirmations/confirmation/templates/__snapshots__/remove-snap-account.test.js.snap index 317071e6be26..54af64008a0b 100644 --- a/ui/pages/confirmations/confirmation/templates/__snapshots__/remove-snap-account.test.js.snap +++ b/ui/pages/confirmations/confirmation/templates/__snapshots__/remove-snap-account.test.js.snap @@ -341,7 +341,7 @@ exports[`remove-snap-account confirmation should match snapshot 1`] = ` - GoerliETH + GOERLIETH @@ -385,7 +385,7 @@ exports[`remove-snap-account confirmation should match snapshot 1`] = ` - GoerliETH + GOERLIETH From b2e911153b2b9714e2513edf6eded64d0f7943d4 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 11:08:22 -0800 Subject: [PATCH 13/37] fix: Lint --- ui/components/app/assets/asset-list/asset-list.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/components/app/assets/asset-list/asset-list.tsx b/ui/components/app/assets/asset-list/asset-list.tsx index 9c0bcde992b1..14412909af5c 100644 --- a/ui/components/app/assets/asset-list/asset-list.tsx +++ b/ui/components/app/assets/asset-list/asset-list.tsx @@ -9,7 +9,7 @@ import { getSelectedAccount, } from '../../../../selectors'; import { - getMultichainIsEvm, + // getMultichainIsEvm, getMultichainSelectedAccountCachedBalance, ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) getMultichainIsBitcoin, @@ -93,10 +93,10 @@ const AssetList = ({ onClickAsset, showTokensLinks }: AssetListProps) => { const isBtc = useSelector(getMultichainIsBitcoin); ///: END:ONLY_INCLUDE_IF - const isEvm = useSelector(getMultichainIsEvm); + // const isEvm = useSelector(getMultichainIsEvm); // NOTE: Since we can parametrize it now, we keep the original behavior // for EVM assets - const shouldShowTokensLinks = showTokensLinks ?? isEvm; + // const shouldShowTokensLinks = showTokensLinks ?? isEvm; return ( <> From 86abc08efb5fb31df33ca0ca8907552f0a77905a Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 11:18:57 -0800 Subject: [PATCH 14/37] chore: Update integration test suite to handle SepoliaETH suffix --- .../ui/currency-display/currency-display.component.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/components/ui/currency-display/currency-display.component.js b/ui/components/ui/currency-display/currency-display.component.js index c49ee47b6086..6bef2b00244e 100644 --- a/ui/components/ui/currency-display/currency-display.component.js +++ b/ui/components/ui/currency-display/currency-display.component.js @@ -48,6 +48,13 @@ export default function CurrencyDisplay({ isAggregatedFiatOverviewBalance, }); + const suffixOverride = (suffixString) => { + if (suffixString === 'SepoliaETH') { + return suffixString; + } + return suffixString.toUpperCase(); + }; + return ( - {parts.suffix.toUpperCase()} + {suffixOverride(parts.suffix)} ) : null} From 9fa4b963bd08083e66e17adc272648b534e03747 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 12:04:34 -0800 Subject: [PATCH 15/37] fix: Import tokens is now a nested click process --- .../transactions/revoke-allowance-redesign.spec.ts | 2 +- test/e2e/tests/tokens/add-hide-token.spec.js | 1 + test/e2e/tests/tokens/custom-token-add-approve.spec.js | 3 ++- test/e2e/tests/tokens/token-details.spec.ts | 1 + test/e2e/tests/tokens/token-list.spec.ts | 1 + test/e2e/tests/tokens/token-sort.spec.ts | 1 + 6 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/e2e/tests/confirmations/transactions/revoke-allowance-redesign.spec.ts b/test/e2e/tests/confirmations/transactions/revoke-allowance-redesign.spec.ts index ba97d9cda4cd..07ebd8469f7a 100644 --- a/test/e2e/tests/confirmations/transactions/revoke-allowance-redesign.spec.ts +++ b/test/e2e/tests/confirmations/transactions/revoke-allowance-redesign.spec.ts @@ -60,7 +60,7 @@ describe('Confirmation Redesign ERC20 Revoke Allowance', function () { ); }); - it('Sends a type 2 transaction (EIP1559)', async function () { + it.only('Sends a type 2 transaction (EIP1559)', async function () { await withFixtures( { dapp: true, diff --git a/test/e2e/tests/tokens/add-hide-token.spec.js b/test/e2e/tests/tokens/add-hide-token.spec.js index 6bd0c8744fba..c9a1f26ad9eb 100644 --- a/test/e2e/tests/tokens/add-hide-token.spec.js +++ b/test/e2e/tests/tokens/add-hide-token.spec.js @@ -130,6 +130,7 @@ describe('Add existing token using search', function () { await unlockWallet(driver); await driver.clickElement(`[data-testid="import-token-button"]`); + await driver.clickElement(`[data-testid="importTokens"]`); await driver.fill('input[placeholder="Search tokens"]', 'BAT'); await driver.clickElement({ text: 'BAT', diff --git a/test/e2e/tests/tokens/custom-token-add-approve.spec.js b/test/e2e/tests/tokens/custom-token-add-approve.spec.js index 8fa765a36164..7dd79f4ccc37 100644 --- a/test/e2e/tests/tokens/custom-token-add-approve.spec.js +++ b/test/e2e/tests/tokens/custom-token-add-approve.spec.js @@ -15,7 +15,7 @@ const { SMART_CONTRACTS } = require('../../seeder/smart-contracts'); describe('Create token, approve token and approve token without gas', function () { const smartContract = SMART_CONTRACTS.HST; - it('imports and renders the balance for the new token', async function () { + it.only('imports and renders the balance for the new token', async function () { await withFixtures( { fixtures: new FixtureBuilder().build(), @@ -36,6 +36,7 @@ describe('Create token, approve token and approve token without gas', function ( await clickNestedButton(driver, 'Tokens'); await driver.clickElement(`[data-testid="import-token-button"]`); + await driver.clickElement(`[data-testid="importTokens"]`); await clickNestedButton(driver, 'Custom token'); await driver.fill( '[data-testid="import-tokens-modal-custom-address"]', diff --git a/test/e2e/tests/tokens/token-details.spec.ts b/test/e2e/tests/tokens/token-details.spec.ts index 56d9515e727d..2ee84d339ea8 100644 --- a/test/e2e/tests/tokens/token-details.spec.ts +++ b/test/e2e/tests/tokens/token-details.spec.ts @@ -28,6 +28,7 @@ describe('Token Details', function () { const importToken = async (driver: Driver) => { await driver.clickElement(`[data-testid="import-token-button"]`); + await driver.clickElement(`[data-testid="importTokens"]`); await clickNestedButton(driver, 'Custom token'); await driver.fill( '[data-testid="import-tokens-modal-custom-address"]', diff --git a/test/e2e/tests/tokens/token-list.spec.ts b/test/e2e/tests/tokens/token-list.spec.ts index c20a9f13b0e3..f7b032c92a4c 100644 --- a/test/e2e/tests/tokens/token-list.spec.ts +++ b/test/e2e/tests/tokens/token-list.spec.ts @@ -28,6 +28,7 @@ describe('Token List', function () { const importToken = async (driver: Driver) => { await driver.clickElement(`[data-testid="import-token-button"]`); + await driver.clickElement(`[data-testid="importTokens"]`); await clickNestedButton(driver, 'Custom token'); await driver.fill( '[data-testid="import-tokens-modal-custom-address"]', diff --git a/test/e2e/tests/tokens/token-sort.spec.ts b/test/e2e/tests/tokens/token-sort.spec.ts index c7611a3b10ba..ff2d35a917dc 100644 --- a/test/e2e/tests/tokens/token-sort.spec.ts +++ b/test/e2e/tests/tokens/token-sort.spec.ts @@ -26,6 +26,7 @@ describe('Token List', function () { const importToken = async (driver: Driver) => { await driver.clickElement(`[data-testid="import-token-button"]`); + await driver.clickElement(`[data-testid="importTokens"]`); await clickNestedButton(driver, 'Custom token'); await driver.fill( '[data-testid="import-tokens-modal-custom-address"]', From e31e63f9dce3cf00be94fd6a2ea5f2187731fe89 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 12:40:35 -0800 Subject: [PATCH 16/37] fix: Update testId for import token dropdown --- .../confirmations/transactions/erc20-approve-redesign.spec.ts | 1 + test/e2e/tests/tokens/import-tokens.spec.js | 1 + 2 files changed, 2 insertions(+) diff --git a/test/e2e/tests/confirmations/transactions/erc20-approve-redesign.spec.ts b/test/e2e/tests/confirmations/transactions/erc20-approve-redesign.spec.ts index baa3638330b6..4e340f5ef3ac 100644 --- a/test/e2e/tests/confirmations/transactions/erc20-approve-redesign.spec.ts +++ b/test/e2e/tests/confirmations/transactions/erc20-approve-redesign.spec.ts @@ -118,6 +118,7 @@ async function mocks(server: MockttpServer) { export async function importTST(driver: Driver) { await driver.switchToWindowWithTitle(WINDOW_TITLES.ExtensionInFullScreenView); await driver.clickElement('[data-testid="import-token-button"]'); + await driver.clickElement('[data-testid="importTokens"]'); await driver.waitForSelector({ css: '.import-tokens-modal__button-tab', diff --git a/test/e2e/tests/tokens/import-tokens.spec.js b/test/e2e/tests/tokens/import-tokens.spec.js index 3055f7109551..7b1bf60964ab 100644 --- a/test/e2e/tests/tokens/import-tokens.spec.js +++ b/test/e2e/tests/tokens/import-tokens.spec.js @@ -69,6 +69,7 @@ describe('Import flow', function () { await driver.assertElementNotPresent('.loading-overlay'); await driver.clickElement('[data-testid="import-token-button"]'); + await driver.clickElement('[data-testid="importTokens"]'); await driver.fill('input[placeholder="Search tokens"]', 'cha'); From c47c743aa8e840ed175a563e1ffe5f8204bca46d Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 13:08:43 -0800 Subject: [PATCH 17/37] fix: Selector for refresh button is now nested within two clicks --- test/e2e/tests/privacy/basic-functionality.spec.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/tests/privacy/basic-functionality.spec.js b/test/e2e/tests/privacy/basic-functionality.spec.js index e6439c569339..4ceb7a249261 100644 --- a/test/e2e/tests/privacy/basic-functionality.spec.js +++ b/test/e2e/tests/privacy/basic-functionality.spec.js @@ -102,6 +102,7 @@ describe('MetaMask onboarding @no-mmi', function () { // Wait until network is fully switched and refresh tokens before asserting to mitigate flakiness await driver.assertElementNotPresent('.loading-overlay'); + await driver.clickElement(`[data-testid="import-token-button"]`); await driver.clickElement('[data-testid="refresh-list-button"]'); for (let i = 0; i < mockedEndpoints.length; i += 1) { @@ -157,6 +158,7 @@ describe('MetaMask onboarding @no-mmi', function () { // Wait until network is fully switched and refresh tokens before asserting to mitigate flakiness await driver.assertElementNotPresent('.loading-overlay'); + await driver.clickElement(`[data-testid="import-token-button"]`); await driver.clickElement('[data-testid="refresh-list-button"]'); // intended delay to allow for network requests to complete await driver.delay(1000); From 7dbc7de82dbcf66fdc421a0e6ebb227281dda13d Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 13:21:03 -0800 Subject: [PATCH 18/37] fix: Remove exclusive test --- test/e2e/tests/tokens/custom-token-add-approve.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/tests/tokens/custom-token-add-approve.spec.js b/test/e2e/tests/tokens/custom-token-add-approve.spec.js index 7dd79f4ccc37..4e85aae76fd6 100644 --- a/test/e2e/tests/tokens/custom-token-add-approve.spec.js +++ b/test/e2e/tests/tokens/custom-token-add-approve.spec.js @@ -15,7 +15,7 @@ const { SMART_CONTRACTS } = require('../../seeder/smart-contracts'); describe('Create token, approve token and approve token without gas', function () { const smartContract = SMART_CONTRACTS.HST; - it.only('imports and renders the balance for the new token', async function () { + it('imports and renders the balance for the new token', async function () { await withFixtures( { fixtures: new FixtureBuilder().build(), From c01cd5ea96dec5162c5cd98f0e897779265ac53d Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 13:52:07 -0800 Subject: [PATCH 19/37] fix: typo in testId --- test/e2e/tests/privacy/basic-functionality.spec.js | 6 +++--- .../asset-list-control-bar/asset-list-control-bar.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/e2e/tests/privacy/basic-functionality.spec.js b/test/e2e/tests/privacy/basic-functionality.spec.js index 4ceb7a249261..bc8e948cb256 100644 --- a/test/e2e/tests/privacy/basic-functionality.spec.js +++ b/test/e2e/tests/privacy/basic-functionality.spec.js @@ -103,7 +103,7 @@ describe('MetaMask onboarding @no-mmi', function () { // Wait until network is fully switched and refresh tokens before asserting to mitigate flakiness await driver.assertElementNotPresent('.loading-overlay'); await driver.clickElement(`[data-testid="import-token-button"]`); - await driver.clickElement('[data-testid="refresh-list-button"]'); + await driver.clickElement('[data-testid="refreshList"]'); for (let i = 0; i < mockedEndpoints.length; i += 1) { const requests = await mockedEndpoints[i].getSeenRequests(); @@ -118,7 +118,7 @@ describe('MetaMask onboarding @no-mmi', function () { ); }); - it('should not prevent network requests to basic functionality endpoints when the basic functionality toggle is on', async function () { + it.only('should not prevent network requests to basic functionality endpoints when the basic functionality toggle is on', async function () { await withFixtures( { fixtures: new FixtureBuilder({ onboarding: true }).build(), @@ -159,7 +159,7 @@ describe('MetaMask onboarding @no-mmi', function () { // Wait until network is fully switched and refresh tokens before asserting to mitigate flakiness await driver.assertElementNotPresent('.loading-overlay'); await driver.clickElement(`[data-testid="import-token-button"]`); - await driver.clickElement('[data-testid="refresh-list-button"]'); + await driver.clickElement('[data-testid="refreshList"]'); // intended delay to allow for network requests to complete await driver.delay(1000); for (let i = 0; i < mockedEndpoints.length; i += 1) { diff --git a/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx b/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx index 2ed66f9890f7..e5c43aad281d 100644 --- a/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx +++ b/ui/components/app/assets/asset-list/asset-list-control-bar/asset-list-control-bar.tsx @@ -264,7 +264,7 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => { {t('importTokensCamelCase')} - + {t('refreshList')} From 2e92c0dfe04c6a3ab6b9ad8197f5c2f96a2afa8b Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 13:54:38 -0800 Subject: [PATCH 20/37] chore: Cleanup --- test/e2e/tests/privacy/basic-functionality.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/tests/privacy/basic-functionality.spec.js b/test/e2e/tests/privacy/basic-functionality.spec.js index bc8e948cb256..77e9dad0b46f 100644 --- a/test/e2e/tests/privacy/basic-functionality.spec.js +++ b/test/e2e/tests/privacy/basic-functionality.spec.js @@ -118,7 +118,7 @@ describe('MetaMask onboarding @no-mmi', function () { ); }); - it.only('should not prevent network requests to basic functionality endpoints when the basic functionality toggle is on', async function () { + it('should not prevent network requests to basic functionality endpoints when the basic functionality toggle is on', async function () { await withFixtures( { fixtures: new FixtureBuilder({ onboarding: true }).build(), From 4eb2da7ae5b08724ae05de7902d2c963d1ad33fc Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 14:02:10 -0800 Subject: [PATCH 21/37] fix: Tweak formatWithThreshold --- test/e2e/tests/tokens/custom-token-send-transfer.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/tests/tokens/custom-token-send-transfer.spec.js b/test/e2e/tests/tokens/custom-token-send-transfer.spec.js index 40b1872011bd..6a088db85c02 100644 --- a/test/e2e/tests/tokens/custom-token-send-transfer.spec.js +++ b/test/e2e/tests/tokens/custom-token-send-transfer.spec.js @@ -147,7 +147,7 @@ describe('Transfer custom tokens @no-mmi', function () { const tokenAmount = await driver.findElement( { css: '[data-testid="multichain-token-list-item-value"]', - text: '8.5 TST', + text: '8.5000 TST', }, { timeout: 10000 }, ); @@ -209,7 +209,7 @@ describe('Transfer custom tokens @no-mmi', function () { const tokenAmount = await driver.findElement( { css: '[data-testid="multichain-token-list-item-value"]', - text: '8.5 TST', + text: '8.5000 TST', }, { timeout: 10000 }, ); From c3965fe28bf72c226040dcf81a283c20d43ac4bf Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 15:05:00 -0800 Subject: [PATCH 22/37] fix: Add test data storybook ci --- .storybook/test-data.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.storybook/test-data.js b/.storybook/test-data.js index 4ef6de0a689c..a36cbf944981 100644 --- a/.storybook/test-data.js +++ b/.storybook/test-data.js @@ -487,6 +487,32 @@ const state = { }, }, }, + allTokens: { + '0x1': { + '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4': [ + { + address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', + aggregators: [], + decimals: 6, + symbol: 'USDC', + }, + { + address: '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e', + aggregators: [], + decimals: 18, + symbol: 'YFI', + }, + ], + }, + }, + tokenBalances: { + '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4': { + '0x1': { + '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48': '0xbdbd', + '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e': '0x501b4176a64d6', + }, + }, + }, tokens: [ { address: '0xaD6D458402F60fD3Bd25163575031ACDce07538A', From 33989eb8cb82192a225c1db1ae09a16347362bb8 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 15:41:07 -0800 Subject: [PATCH 23/37] fix: Tweak code fencing to prevent undefined variables outside of fence --- ui/components/app/assets/asset-list/asset-list.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/components/app/assets/asset-list/asset-list.tsx b/ui/components/app/assets/asset-list/asset-list.tsx index 14412909af5c..ca10442adbbf 100644 --- a/ui/components/app/assets/asset-list/asset-list.tsx +++ b/ui/components/app/assets/asset-list/asset-list.tsx @@ -13,8 +13,8 @@ import { getMultichainSelectedAccountCachedBalance, ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) getMultichainIsBitcoin, - ///: END:ONLY_INCLUDE_IF getMultichainSelectedAccountCachedBalanceIsZero, + ///: END:ONLY_INCLUDE_IF } from '../../../../selectors/multichain'; import { useCurrencyDisplay } from '../../../../hooks/useCurrencyDisplay'; import { MetaMetricsContext } from '../../../../contexts/metametrics'; @@ -83,11 +83,10 @@ const AssetList = ({ onClickAsset, showTokensLinks }: AssetListProps) => { setShowReceiveModal(true); }; + ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) const balanceIsZero = useSelector( getMultichainSelectedAccountCachedBalanceIsZero, ); - - ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) const isBuyableChain = useSelector(getIsNativeTokenBuyable); const shouldShowBuy = isBuyableChain && balanceIsZero; const isBtc = useSelector(getMultichainIsBitcoin); From c1cbb1f91e3709c7c90782227bc16ec5b341b9dc Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Wed, 20 Nov 2024 03:13:56 +0000 Subject: [PATCH 24/37] Update LavaMoat policies --- lavamoat/build-system/policy.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index 06d6042f6433..5338922720ef 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -2040,8 +2040,7 @@ "chokidar>normalize-path": true, "chokidar>readdirp": true, "del>is-glob": true, - "eslint>glob-parent": true, - "tsx>fsevents": true + "eslint>glob-parent": true } }, "chokidar>anymatch": { @@ -8839,13 +8838,6 @@ "typescript": true } }, - "tsx>fsevents": { - "globals": { - "console.assert": true, - "process.platform": true - }, - "native": true - }, "typescript": { "builtin": { "buffer.Buffer": true, From 53b7c90ff72f075daf320d4699f19947757dfcab Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Tue, 19 Nov 2024 21:42:27 -0800 Subject: [PATCH 25/37] fix: Remove exclusive only test --- .../transactions/revoke-allowance-redesign.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/tests/confirmations/transactions/revoke-allowance-redesign.spec.ts b/test/e2e/tests/confirmations/transactions/revoke-allowance-redesign.spec.ts index 07ebd8469f7a..ba97d9cda4cd 100644 --- a/test/e2e/tests/confirmations/transactions/revoke-allowance-redesign.spec.ts +++ b/test/e2e/tests/confirmations/transactions/revoke-allowance-redesign.spec.ts @@ -60,7 +60,7 @@ describe('Confirmation Redesign ERC20 Revoke Allowance', function () { ); }); - it.only('Sends a type 2 transaction (EIP1559)', async function () { + it('Sends a type 2 transaction (EIP1559)', async function () { await withFixtures( { dapp: true, From 3accb6a89badc93a0292a6dff7d366ddea89fdcb Mon Sep 17 00:00:00 2001 From: NidhiKJha Date: Wed, 20 Nov 2024 16:22:33 +0000 Subject: [PATCH 26/37] fixed spec file for BTC Account - Overview has balance --- test/e2e/flask/btc/btc-account-overview.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/flask/btc/btc-account-overview.spec.ts b/test/e2e/flask/btc/btc-account-overview.spec.ts index 418c9d736078..5a9e4756f56f 100644 --- a/test/e2e/flask/btc/btc-account-overview.spec.ts +++ b/test/e2e/flask/btc/btc-account-overview.spec.ts @@ -41,7 +41,7 @@ describe('BTC Account - Overview', function (this: Suite) { ); }); - it('has balance', async function () { + it.only('has balance', async function () { await withBtcAccountSnap( { title: this.test?.fullTitle() }, async (driver) => { @@ -55,7 +55,7 @@ describe('BTC Account - Overview', function (this: Suite) { }); await driver.waitForSelector({ - tag: 'p', + css: '.coin-overview__primary-container', text: `${DEFAULT_BTC_BALANCE} BTC`, }); }, From c3a5f27f9ce0d48eee39af5ee01c6caf6576a40a Mon Sep 17 00:00:00 2001 From: NidhiKJha Date: Wed, 20 Nov 2024 16:29:00 +0000 Subject: [PATCH 27/37] nit fix --- test/e2e/flask/btc/btc-account-overview.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/flask/btc/btc-account-overview.spec.ts b/test/e2e/flask/btc/btc-account-overview.spec.ts index 5a9e4756f56f..5eb5f4e23187 100644 --- a/test/e2e/flask/btc/btc-account-overview.spec.ts +++ b/test/e2e/flask/btc/btc-account-overview.spec.ts @@ -41,7 +41,7 @@ describe('BTC Account - Overview', function (this: Suite) { ); }); - it.only('has balance', async function () { + it('has balance', async function () { await withBtcAccountSnap( { title: this.test?.fullTitle() }, async (driver) => { From f08cbf745ea3a505e009075b93d6562358baaad1 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Wed, 20 Nov 2024 10:18:37 -0800 Subject: [PATCH 28/37] fix: Legitimate fix to custom-token-send-transfer.spec.js made upstream, formatting hack no longer needed --- test/e2e/tests/tokens/custom-token-send-transfer.spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/tests/tokens/custom-token-send-transfer.spec.js b/test/e2e/tests/tokens/custom-token-send-transfer.spec.js index 6a088db85c02..fbccf1d7981b 100644 --- a/test/e2e/tests/tokens/custom-token-send-transfer.spec.js +++ b/test/e2e/tests/tokens/custom-token-send-transfer.spec.js @@ -97,7 +97,7 @@ describe('Transfer custom tokens @no-mmi', function () { ); }); - it('transfer custom tokens from dapp customizing gas values', async function () { + it.only('transfer custom tokens from dapp customizing gas values', async function () { await withFixtures( { dapp: true, @@ -147,7 +147,7 @@ describe('Transfer custom tokens @no-mmi', function () { const tokenAmount = await driver.findElement( { css: '[data-testid="multichain-token-list-item-value"]', - text: '8.5000 TST', + text: '8.5 TST', }, { timeout: 10000 }, ); @@ -209,7 +209,7 @@ describe('Transfer custom tokens @no-mmi', function () { const tokenAmount = await driver.findElement( { css: '[data-testid="multichain-token-list-item-value"]', - text: '8.5000 TST', + text: '8.5 TST', }, { timeout: 10000 }, ); From 492960f04731598876d7634e85beda13b17cf0a5 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Wed, 20 Nov 2024 10:19:32 -0800 Subject: [PATCH 29/37] fix: Remove exclusive only test --- test/e2e/tests/tokens/custom-token-send-transfer.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/tests/tokens/custom-token-send-transfer.spec.js b/test/e2e/tests/tokens/custom-token-send-transfer.spec.js index fbccf1d7981b..40b1872011bd 100644 --- a/test/e2e/tests/tokens/custom-token-send-transfer.spec.js +++ b/test/e2e/tests/tokens/custom-token-send-transfer.spec.js @@ -97,7 +97,7 @@ describe('Transfer custom tokens @no-mmi', function () { ); }); - it.only('transfer custom tokens from dapp customizing gas values', async function () { + it('transfer custom tokens from dapp customizing gas values', async function () { await withFixtures( { dapp: true, From a19a7e1ae7d270945f4f69680e76dff6b477a08f Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Wed, 20 Nov 2024 21:42:14 -0800 Subject: [PATCH 30/37] fix: Revert temp change to btc flask test --- test/e2e/flask/btc/btc-account-overview.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/flask/btc/btc-account-overview.spec.ts b/test/e2e/flask/btc/btc-account-overview.spec.ts index 5eb5f4e23187..2e9ce34c39ea 100644 --- a/test/e2e/flask/btc/btc-account-overview.spec.ts +++ b/test/e2e/flask/btc/btc-account-overview.spec.ts @@ -55,7 +55,7 @@ describe('BTC Account - Overview', function (this: Suite) { }); await driver.waitForSelector({ - css: '.coin-overview__primary-container', + css: 'p', text: `${DEFAULT_BTC_BALANCE} BTC`, }); }, From 328413ea9ee3d1aea3ee5df938e86bc57163a2fe Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Wed, 20 Nov 2024 21:44:59 -0800 Subject: [PATCH 31/37] fix: Align upstream branch with flask changes --- ui/components/app/assets/asset-list/asset-list.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/components/app/assets/asset-list/asset-list.tsx b/ui/components/app/assets/asset-list/asset-list.tsx index 957b95250515..d58d1ad478e0 100644 --- a/ui/components/app/assets/asset-list/asset-list.tsx +++ b/ui/components/app/assets/asset-list/asset-list.tsx @@ -14,6 +14,7 @@ import { ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) getMultichainIsBitcoin, getMultichainSelectedAccountCachedBalanceIsZero, + getMultichainIsEvm, ///: END:ONLY_INCLUDE_IF } from '../../../../selectors/multichain'; import { useCurrencyDisplay } from '../../../../hooks/useCurrencyDisplay'; @@ -93,10 +94,10 @@ const AssetList = ({ onClickAsset, showTokensLinks }: AssetListProps) => { const isBtc = useSelector(getMultichainIsBitcoin); ///: END:ONLY_INCLUDE_IF - // const isEvm = useSelector(getMultichainIsEvm); + const isEvm = useSelector(getMultichainIsEvm); // NOTE: Since we can parametrize it now, we keep the original behavior // for EVM assets - // const shouldShowTokensLinks = showTokensLinks ?? isEvm; + const shouldShowTokensLinks = showTokensLinks ?? isEvm; return ( <> From 08e61d6ff4c09fc2715dea94a54b6a311eb13a74 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Wed, 20 Nov 2024 21:46:10 -0800 Subject: [PATCH 32/37] fix: Remove suffix override --- .../ui/currency-display/currency-display.component.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ui/components/ui/currency-display/currency-display.component.js b/ui/components/ui/currency-display/currency-display.component.js index 6bef2b00244e..7e2569ffaee3 100644 --- a/ui/components/ui/currency-display/currency-display.component.js +++ b/ui/components/ui/currency-display/currency-display.component.js @@ -48,13 +48,6 @@ export default function CurrencyDisplay({ isAggregatedFiatOverviewBalance, }); - const suffixOverride = (suffixString) => { - if (suffixString === 'SepoliaETH') { - return suffixString; - } - return suffixString.toUpperCase(); - }; - return ( - {suffixOverride(parts.suffix)} + {parts.suffix} ) : null} From 1a111507639489f182521c89a984fbd04d0a5f58 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Wed, 20 Nov 2024 21:50:29 -0800 Subject: [PATCH 33/37] fix: Update snapshots from suffix shenanigans --- .../__snapshots__/asset-balance-text.test.tsx.snap | 2 +- .../templates/__snapshots__/remove-snap-account.test.js.snap | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/components/multichain/asset-picker-amount/asset-balance/__snapshots__/asset-balance-text.test.tsx.snap b/ui/components/multichain/asset-picker-amount/asset-balance/__snapshots__/asset-balance-text.test.tsx.snap index 931310418d60..a0c808186082 100644 --- a/ui/components/multichain/asset-picker-amount/asset-balance/__snapshots__/asset-balance-text.test.tsx.snap +++ b/ui/components/multichain/asset-picker-amount/asset-balance/__snapshots__/asset-balance-text.test.tsx.snap @@ -15,7 +15,7 @@ exports[`AssetBalanceText matches snapshot 1`] = ` - SUFFIX + suffix diff --git a/ui/pages/confirmations/confirmation/templates/__snapshots__/remove-snap-account.test.js.snap b/ui/pages/confirmations/confirmation/templates/__snapshots__/remove-snap-account.test.js.snap index 54af64008a0b..317071e6be26 100644 --- a/ui/pages/confirmations/confirmation/templates/__snapshots__/remove-snap-account.test.js.snap +++ b/ui/pages/confirmations/confirmation/templates/__snapshots__/remove-snap-account.test.js.snap @@ -341,7 +341,7 @@ exports[`remove-snap-account confirmation should match snapshot 1`] = ` - GOERLIETH + GoerliETH @@ -385,7 +385,7 @@ exports[`remove-snap-account confirmation should match snapshot 1`] = ` - GOERLIETH + GoerliETH From 53be791a31caab107a85ab43fb0370352cc45399 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Wed, 20 Nov 2024 21:51:41 -0800 Subject: [PATCH 34/37] fix: Remove optional chain diff. We may need to replace this for e2e --- ui/selectors/selectors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index 0e48b6c16315..9852d4ae7d25 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -505,7 +505,7 @@ export function getSelectedAccountTokensAcrossChains(state) { ...Object.keys(nativeTokenBalancesByChainId || {}), ]); - chainIds?.forEach((chainId) => { + chainIds.forEach((chainId) => { if (!tokensByChain[chainId]) { tokensByChain[chainId] = []; } From 57cfbe2332dd83f8d4689935081acb98f4bdc817 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Wed, 20 Nov 2024 21:52:27 -0800 Subject: [PATCH 35/37] fix: typo in e2e selector --- test/e2e/flask/btc/btc-account-overview.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/flask/btc/btc-account-overview.spec.ts b/test/e2e/flask/btc/btc-account-overview.spec.ts index 2e9ce34c39ea..418c9d736078 100644 --- a/test/e2e/flask/btc/btc-account-overview.spec.ts +++ b/test/e2e/flask/btc/btc-account-overview.spec.ts @@ -55,7 +55,7 @@ describe('BTC Account - Overview', function (this: Suite) { }); await driver.waitForSelector({ - css: 'p', + tag: 'p', text: `${DEFAULT_BTC_BALANCE} BTC`, }); }, From 1b17bec3bb9b9ccb56530c0173073c87c54a8232 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Wed, 20 Nov 2024 21:53:16 -0800 Subject: [PATCH 36/37] fix: Fix duped import --- ui/components/app/assets/asset-list/asset-list.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/components/app/assets/asset-list/asset-list.tsx b/ui/components/app/assets/asset-list/asset-list.tsx index d58d1ad478e0..068813ee71c8 100644 --- a/ui/components/app/assets/asset-list/asset-list.tsx +++ b/ui/components/app/assets/asset-list/asset-list.tsx @@ -9,12 +9,11 @@ import { getSelectedAccount, } from '../../../../selectors'; import { - // getMultichainIsEvm, + getMultichainIsEvm, getMultichainSelectedAccountCachedBalance, ///: BEGIN:ONLY_INCLUDE_IF(build-main,build-beta,build-flask) getMultichainIsBitcoin, getMultichainSelectedAccountCachedBalanceIsZero, - getMultichainIsEvm, ///: END:ONLY_INCLUDE_IF } from '../../../../selectors/multichain'; import { useCurrencyDisplay } from '../../../../hooks/useCurrencyDisplay'; From 1a8cb68566ffa3e0af238c41962715bea04c2132 Mon Sep 17 00:00:00 2001 From: Nicholas Gambino Date: Wed, 20 Nov 2024 22:05:09 -0800 Subject: [PATCH 37/37] fix: Dedupe fixture builder --- test/e2e/default-fixture.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e/default-fixture.js b/test/e2e/default-fixture.js index 785ef1ac91c1..c2fba9d63424 100644 --- a/test/e2e/default-fixture.js +++ b/test/e2e/default-fixture.js @@ -224,7 +224,6 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) { order: 'dsc', sortCallback: 'stringNumeric', }, - tokenNetworkFilter: {}, shouldShowAggregatedBalancePopover: true, tokenNetworkFilter: {}, },