From 32f3bb3329039805f6d0cb637ca5e9aad7eb847a Mon Sep 17 00:00:00 2001 From: David Walsh Date: Wed, 13 Nov 2024 18:26:43 -0600 Subject: [PATCH 01/12] Remove feature flag --- builds.yml | 2 - lavamoat/browserify/beta/policy.json | 3 - lavamoat/browserify/flask/policy.json | 3 - lavamoat/browserify/main/policy.json | 3 - lavamoat/browserify/mmi/policy.json | 3 - lavamoat/build-system/policy.json | 180 ++++++++++++++++-- test/e2e/default-fixture.js | 1 + .../asset-list-control-bar.tsx | 43 ++--- 8 files changed, 181 insertions(+), 57 deletions(-) diff --git a/builds.yml b/builds.yml index 316e8f943eb1..851bad0f7610 100644 --- a/builds.yml +++ b/builds.yml @@ -284,8 +284,6 @@ env: - BARAD_DUR: '' # Determines if feature flagged Chain permissions - CHAIN_PERMISSIONS: '' - # Determines if Portfolio View UI should be shown - - PORTFOLIO_VIEW: '' # Enables use of test gas fee flow to debug gas fee estimation - TEST_GAS_FEE_FLOWS: false # Temporary mechanism to enable security alerts API prior to release diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 2993482ec504..94bf575e610a 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2603,9 +2603,6 @@ } }, "@metamask/signature-controller": { - "globals": { - "fetch": true - }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 2993482ec504..94bf575e610a 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2603,9 +2603,6 @@ } }, "@metamask/signature-controller": { - "globals": { - "fetch": true - }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 2993482ec504..94bf575e610a 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2603,9 +2603,6 @@ } }, "@metamask/signature-controller": { - "globals": { - "fetch": true - }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 02d73c44f420..9acbc67302ab 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -2695,9 +2695,6 @@ } }, "@metamask/signature-controller": { - "globals": { - "fetch": true - }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index 2d6b7ce3ad14..629492c40425 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -116,12 +116,22 @@ "console.warn": true }, "packages": { + "@babel/core>@babel/generator>@babel/types": true, "@babel/core>@babel/generator>jsesc": true, - "@babel/core>@babel/types": true, "terser-webpack-plugin>@jridgewell/trace-mapping": true, "terser>@jridgewell/source-map>@jridgewell/gen-mapping": true } }, + "@babel/core>@babel/generator>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + } + }, "@babel/core>@babel/generator>jsesc": { "globals": { "Buffer": true @@ -172,25 +182,65 @@ "assert": true }, "packages": { - "@babel/core>@babel/types": true + "@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports>@babel/types": true + } + }, + "@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } }, "@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access": { "packages": { - "@babel/core>@babel/types": true + "@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access>@babel/types": true + } + }, + "@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } }, "@babel/core>@babel/helpers": { "packages": { - "@babel/core>@babel/template": true, - "@babel/core>@babel/types": true + "@babel/core>@babel/helpers>@babel/types": true, + "@babel/core>@babel/template": true + } + }, + "@babel/core>@babel/helpers>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } }, "@babel/core>@babel/template": { "packages": { "@babel/code-frame": true, "@babel/core>@babel/parser": true, - "@babel/core>@babel/types": true + "@babel/core>@babel/template>@babel/types": true + } + }, + "@babel/core>@babel/template>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } }, "@babel/core>@babel/types": { @@ -431,10 +481,20 @@ "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator>@babel/helper-wrap-function": { "packages": { "@babel/core>@babel/template": true, - "@babel/core>@babel/types": true, + "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator>@babel/helper-wrap-function>@babel/types": true, "depcheck>@babel/traverse": true } }, + "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator>@babel/helper-wrap-function>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + } + }, "@babel/preset-env>@babel/plugin-transform-block-scoped-functions": { "packages": { "@babel/core": true, @@ -472,7 +532,17 @@ }, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": { "packages": { - "@babel/core>@babel/types": true + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure>@babel/types": true + } + }, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } }, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers": { @@ -485,12 +555,32 @@ }, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions": { "packages": { - "@babel/core>@babel/types": true + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions>@babel/types": true + } + }, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } }, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-optimise-call-expression": { "packages": { - "@babel/core>@babel/types": true + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-optimise-call-expression>@babel/types": true + } + }, + "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-optimise-call-expression>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } }, "@babel/preset-env>@babel/plugin-transform-computed-properties": { @@ -585,7 +675,17 @@ }, "@babel/preset-env>@babel/plugin-transform-exponentiation-operator>@babel/helper-builder-binary-assignment-operator-visitor": { "packages": { - "@babel/core>@babel/types": true + "@babel/preset-env>@babel/plugin-transform-exponentiation-operator>@babel/helper-builder-binary-assignment-operator-visitor>@babel/types": true + } + }, + "@babel/preset-env>@babel/plugin-transform-exponentiation-operator>@babel/helper-builder-binary-assignment-operator-visitor>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } }, "@babel/preset-env>@babel/plugin-transform-export-namespace-from": { @@ -603,7 +703,17 @@ }, "@babel/preset-env>@babel/plugin-transform-for-of>@babel/helper-skip-transparent-expression-wrappers": { "packages": { - "@babel/core>@babel/types": true + "@babel/preset-env>@babel/plugin-transform-for-of>@babel/helper-skip-transparent-expression-wrappers>@babel/types": true + } + }, + "@babel/preset-env>@babel/plugin-transform-for-of>@babel/helper-skip-transparent-expression-wrappers>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } }, "@babel/preset-env>@babel/plugin-transform-function-name": { @@ -1151,6 +1261,17 @@ "@metamask/object-multiplex>once>wrappy": true } }, + "@metamask/snaps-utils>@babel/types": { + "globals": { + "console.warn": true, + "process.env.BABEL_TYPES_8_BREAKING": true + }, + "packages": { + "@metamask/snaps-utils>@babel/types>@babel/helper-string-parser": true, + "@metamask/snaps-utils>@babel/types>@babel/helper-validator-identifier": true, + "@metamask/snaps-utils>@babel/types>to-fast-properties": true + } + }, "@metamask/utils>@scure/base": { "globals": { "TextDecoder": true, @@ -2040,7 +2161,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": { @@ -2270,12 +2392,22 @@ "@babel/core>@babel/generator": true, "@babel/core>@babel/parser": true, "@babel/core>@babel/template": true, - "@babel/core>@babel/types": true, "babel/preset-env>b@babel/types": true, + "depcheck>@babel/traverse>@babel/types": true, "depcheck>@babel/traverse>globals": true, "nock>debug": true } }, + "depcheck>@babel/traverse>@babel/types": { + "globals": { + "console.warn": true, + "process.env": true + }, + "packages": { + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + } + }, "depcheck>cosmiconfig>parse-json": { "packages": { "@babel/code-frame": true, @@ -6239,11 +6371,12 @@ "lavamoat-viz>lavamoat-core>lavamoat-tofu>@babel/traverse>@babel/types": { "globals": { "console.warn": true, - "process.env": true + "process.env.BABEL_TYPES_8_BREAKING": true }, "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + "@metamask/snaps-utils>@babel/types>to-fast-properties": true, + "lavamoat-viz>lavamoat-core>lavamoat-tofu>@babel/traverse>@babel/types>@babel/helper-string-parser": true, + "lavamoat-viz>lavamoat-core>lavamoat-tofu>@babel/traverse>@babel/types>@babel/helper-validator-identifier": true } }, "lavamoat>@lavamoat/aa": { @@ -6321,17 +6454,17 @@ "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name": { "packages": { "@babel/core>@babel/template": true, - "@babel/core>@babel/types": true + "@metamask/snaps-utils>@babel/types": true } }, "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-hoist-variables": { "packages": { - "@babel/core>@babel/types": true + "@metamask/snaps-utils>@babel/types": true } }, "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-split-export-declaration": { "packages": { - "@babel/core>@babel/types": true + "@metamask/snaps-utils>@babel/types": true } }, "lodash": { @@ -8781,6 +8914,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/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..128cd8b86beb 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 @@ -99,29 +99,26 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => { isFullScreen ? JustifyContent.flexStart : JustifyContent.spaceBetween } > - {process.env.PORTFOLIO_VIEW && ( - - {allNetworksFilterShown - ? currentNetwork?.nickname ?? t('currentNetwork') - : t('allNetworks')} - - )} - + + {allNetworksFilterShown + ? currentNetwork?.nickname ?? t('currentNetwork') + : t('allNetworks')} + Date: Wed, 13 Nov 2024 18:40:48 -0600 Subject: [PATCH 02/12] Dedupe --- yarn.lock | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/yarn.lock b/yarn.lock index b8bb02100184..344b6196d8c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -406,13 +406,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.24.8": - version: 7.24.8 - resolution: "@babel/helper-string-parser@npm:7.24.8" - checksum: 10/6d1bf8f27dd725ce02bdc6dffca3c95fb9ab8a06adc2edbd9c1c9d68500274230d1a609025833ed81981eff560045b6b38f7b4c6fb1ab19fc90e5004e3932535 - languageName: node - linkType: hard - "@babel/helper-validator-identifier@npm:^7.22.20, @babel/helper-validator-identifier@npm:^7.25.9": version: 7.25.9 resolution: "@babel/helper-validator-identifier@npm:7.25.9" @@ -420,13 +413,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.24.7": - version: 7.24.7 - resolution: "@babel/helper-validator-identifier@npm:7.24.7" - checksum: 10/86875063f57361471b531dbc2ea10bbf5406e12b06d249b03827d361db4cad2388c6f00936bcd9dc86479f7e2c69ea21412c2228d4b3672588b754b70a449d4b - languageName: node - linkType: hard - "@babel/helper-validator-option@npm:^7.23.5, @babel/helper-validator-option@npm:^7.25.9": version: 7.25.9 resolution: "@babel/helper-validator-option@npm:7.25.9" @@ -1660,18 +1646,7 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.0, @babel/types@npm:^7.13.0, @babel/types@npm:^7.18.9, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.24.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": - version: 7.25.4 - resolution: "@babel/types@npm:7.25.4" - dependencies: - "@babel/helper-string-parser": "npm:^7.24.8" - "@babel/helper-validator-identifier": "npm:^7.24.7" - to-fast-properties: "npm:^2.0.0" - checksum: 10/d4a1194612d0a2a6ce9a0be325578b43d74e5f5278c67409468ba0a924341f0ad349ef0245ee8a36da3766efe5cc59cd6bb52547674150f97d8dc4c8cfa5d6b8 - languageName: node - linkType: hard - -"@babel/types@npm:^7.20.0, @babel/types@npm:^7.25.9": +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.0, @babel/types@npm:^7.13.0, @babel/types@npm:^7.18.9, @babel/types@npm:^7.20.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0, @babel/types@npm:^7.24.0, @babel/types@npm:^7.24.7, @babel/types@npm:^7.25.9, @babel/types@npm:^7.3.3, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3": version: 7.26.0 resolution: "@babel/types@npm:7.26.0" dependencies: @@ -38260,7 +38235,7 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.3.4": +"yaml@npm:^2.3.4, yaml@npm:^2.4.1": version: 2.6.0 resolution: "yaml@npm:2.6.0" bin: @@ -38269,15 +38244,6 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.4.1": - version: 2.4.1 - resolution: "yaml@npm:2.4.1" - bin: - yaml: bin.mjs - checksum: 10/2c54fd69ef59126758ae710f9756405a7d41abcbb61aca894250d0e81e76057c14dc9bb00a9528f72f99b8f24077f694a6f7fd09cdd6711fcec2eebfbb5df409 - languageName: node - linkType: hard - "yargs-parser@npm:20.2.4": version: 20.2.4 resolution: "yargs-parser@npm:20.2.4" From 96ec099039824ce73e1d0abf2e8f43661d5bebd6 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Wed, 13 Nov 2024 18:42:56 -0600 Subject: [PATCH 03/12] Fix storybook --- .storybook/test-data.js | 1 + 1 file changed, 1 insertion(+) 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, From 944651a5d1b858c1e5b22c337784b25ab497f061 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Wed, 13 Nov 2024 19:10:22 -0600 Subject: [PATCH 04/12] Shim Object.keys --- lavamoat/browserify/beta/policy.json | 3 + lavamoat/browserify/flask/policy.json | 3 + lavamoat/browserify/main/policy.json | 3 + lavamoat/browserify/mmi/policy.json | 3 + lavamoat/build-system/policy.json | 170 ++---------------- .../asset-list-control-bar.tsx | 7 +- .../network-filter/network-filter.tsx | 10 +- 7 files changed, 40 insertions(+), 159 deletions(-) diff --git a/lavamoat/browserify/beta/policy.json b/lavamoat/browserify/beta/policy.json index 94bf575e610a..2993482ec504 100644 --- a/lavamoat/browserify/beta/policy.json +++ b/lavamoat/browserify/beta/policy.json @@ -2603,6 +2603,9 @@ } }, "@metamask/signature-controller": { + "globals": { + "fetch": true + }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/lavamoat/browserify/flask/policy.json b/lavamoat/browserify/flask/policy.json index 94bf575e610a..2993482ec504 100644 --- a/lavamoat/browserify/flask/policy.json +++ b/lavamoat/browserify/flask/policy.json @@ -2603,6 +2603,9 @@ } }, "@metamask/signature-controller": { + "globals": { + "fetch": true + }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/lavamoat/browserify/main/policy.json b/lavamoat/browserify/main/policy.json index 94bf575e610a..2993482ec504 100644 --- a/lavamoat/browserify/main/policy.json +++ b/lavamoat/browserify/main/policy.json @@ -2603,6 +2603,9 @@ } }, "@metamask/signature-controller": { + "globals": { + "fetch": true + }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/lavamoat/browserify/mmi/policy.json b/lavamoat/browserify/mmi/policy.json index 9acbc67302ab..02d73c44f420 100644 --- a/lavamoat/browserify/mmi/policy.json +++ b/lavamoat/browserify/mmi/policy.json @@ -2695,6 +2695,9 @@ } }, "@metamask/signature-controller": { + "globals": { + "fetch": true + }, "packages": { "@metamask/base-controller": true, "@metamask/controller-utils": true, diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index 629492c40425..04be3b9f2867 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -116,22 +116,12 @@ "console.warn": true }, "packages": { - "@babel/core>@babel/generator>@babel/types": true, "@babel/core>@babel/generator>jsesc": true, + "@babel/core>@babel/types": true, "terser-webpack-plugin>@jridgewell/trace-mapping": true, "terser>@jridgewell/source-map>@jridgewell/gen-mapping": true } }, - "@babel/core>@babel/generator>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true - } - }, "@babel/core>@babel/generator>jsesc": { "globals": { "Buffer": true @@ -182,65 +172,25 @@ "assert": true }, "packages": { - "@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports>@babel/types": true - } - }, - "@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + "@babel/core>@babel/types": true } }, "@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access": { "packages": { - "@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access>@babel/types": true - } - }, - "@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + "@babel/core>@babel/types": true } }, "@babel/core>@babel/helpers": { "packages": { - "@babel/core>@babel/helpers>@babel/types": true, - "@babel/core>@babel/template": true - } - }, - "@babel/core>@babel/helpers>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + "@babel/core>@babel/template": true, + "@babel/core>@babel/types": true } }, "@babel/core>@babel/template": { "packages": { "@babel/code-frame": true, "@babel/core>@babel/parser": true, - "@babel/core>@babel/template>@babel/types": true - } - }, - "@babel/core>@babel/template>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + "@babel/core>@babel/types": true } }, "@babel/core>@babel/types": { @@ -481,20 +431,10 @@ "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator>@babel/helper-wrap-function": { "packages": { "@babel/core>@babel/template": true, - "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator>@babel/helper-wrap-function>@babel/types": true, + "@babel/core>@babel/types": true, "depcheck>@babel/traverse": true } }, - "@babel/preset-env>@babel/plugin-transform-async-to-generator>@babel/helper-remap-async-to-generator>@babel/helper-wrap-function>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true - } - }, "@babel/preset-env>@babel/plugin-transform-block-scoped-functions": { "packages": { "@babel/core": true, @@ -532,17 +472,7 @@ }, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure": { "packages": { - "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure>@babel/types": true - } - }, - "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-annotate-as-pure>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + "@babel/core>@babel/types": true } }, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers": { @@ -555,32 +485,12 @@ }, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions": { "packages": { - "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions>@babel/types": true - } - }, - "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-member-expression-to-functions>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + "@babel/core>@babel/types": true } }, "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-optimise-call-expression": { "packages": { - "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-optimise-call-expression>@babel/types": true - } - }, - "@babel/preset-env>@babel/plugin-transform-classes>@babel/helper-replace-supers>@babel/helper-optimise-call-expression>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + "@babel/core>@babel/types": true } }, "@babel/preset-env>@babel/plugin-transform-computed-properties": { @@ -675,17 +585,7 @@ }, "@babel/preset-env>@babel/plugin-transform-exponentiation-operator>@babel/helper-builder-binary-assignment-operator-visitor": { "packages": { - "@babel/preset-env>@babel/plugin-transform-exponentiation-operator>@babel/helper-builder-binary-assignment-operator-visitor>@babel/types": true - } - }, - "@babel/preset-env>@babel/plugin-transform-exponentiation-operator>@babel/helper-builder-binary-assignment-operator-visitor>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + "@babel/core>@babel/types": true } }, "@babel/preset-env>@babel/plugin-transform-export-namespace-from": { @@ -703,17 +603,7 @@ }, "@babel/preset-env>@babel/plugin-transform-for-of>@babel/helper-skip-transparent-expression-wrappers": { "packages": { - "@babel/preset-env>@babel/plugin-transform-for-of>@babel/helper-skip-transparent-expression-wrappers>@babel/types": true - } - }, - "@babel/preset-env>@babel/plugin-transform-for-of>@babel/helper-skip-transparent-expression-wrappers>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true + "@babel/core>@babel/types": true } }, "@babel/preset-env>@babel/plugin-transform-function-name": { @@ -1261,17 +1151,6 @@ "@metamask/object-multiplex>once>wrappy": true } }, - "@metamask/snaps-utils>@babel/types": { - "globals": { - "console.warn": true, - "process.env.BABEL_TYPES_8_BREAKING": true - }, - "packages": { - "@metamask/snaps-utils>@babel/types>@babel/helper-string-parser": true, - "@metamask/snaps-utils>@babel/types>@babel/helper-validator-identifier": true, - "@metamask/snaps-utils>@babel/types>to-fast-properties": true - } - }, "@metamask/utils>@scure/base": { "globals": { "TextDecoder": true, @@ -2392,22 +2271,12 @@ "@babel/core>@babel/generator": true, "@babel/core>@babel/parser": true, "@babel/core>@babel/template": true, + "@babel/core>@babel/types": true, "babel/preset-env>b@babel/types": true, - "depcheck>@babel/traverse>@babel/types": true, "depcheck>@babel/traverse>globals": true, "nock>debug": true } }, - "depcheck>@babel/traverse>@babel/types": { - "globals": { - "console.warn": true, - "process.env": true - }, - "packages": { - "@babel/core>@babel/types>@babel/helper-string-parser": true, - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true - } - }, "depcheck>cosmiconfig>parse-json": { "packages": { "@babel/code-frame": true, @@ -6371,12 +6240,11 @@ "lavamoat-viz>lavamoat-core>lavamoat-tofu>@babel/traverse>@babel/types": { "globals": { "console.warn": true, - "process.env.BABEL_TYPES_8_BREAKING": true + "process.env": true }, "packages": { - "@metamask/snaps-utils>@babel/types>to-fast-properties": true, - "lavamoat-viz>lavamoat-core>lavamoat-tofu>@babel/traverse>@babel/types>@babel/helper-string-parser": true, - "lavamoat-viz>lavamoat-core>lavamoat-tofu>@babel/traverse>@babel/types>@babel/helper-validator-identifier": true + "@babel/core>@babel/types>@babel/helper-string-parser": true, + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true } }, "lavamoat>@lavamoat/aa": { @@ -6454,17 +6322,17 @@ "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name": { "packages": { "@babel/core>@babel/template": true, - "@metamask/snaps-utils>@babel/types": true + "@babel/core>@babel/types": true } }, "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-hoist-variables": { "packages": { - "@metamask/snaps-utils>@babel/types": true + "@babel/core>@babel/types": true } }, "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-split-export-declaration": { "packages": { - "@metamask/snaps-utils>@babel/types": true + "@babel/core>@babel/types": true } }, "lodash": { 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 128cd8b86beb..9a1ac0163ea7 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)); } }, []); diff --git a/ui/components/app/assets/asset-list/network-filter/network-filter.tsx b/ui/components/app/assets/asset-list/network-filter/network-filter.tsx index b90d3cd13235..489d69f11d52 100644 --- a/ui/components/app/assets/asset-list/network-filter/network-filter.tsx +++ b/ui/components/app/assets/asset-list/network-filter/network-filter.tsx @@ -56,14 +56,14 @@ const NetworkFilter = ({ handleClose }: SortControlProps) => { 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)} > @@ -123,7 +123,7 @@ const NetworkFilter = ({ handleClose }: SortControlProps) => { handleFilter({ [chainId]: true })} > From 9da1a80cd9d6d3d4332b20141ebd76f5216baae7 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Wed, 13 Nov 2024 19:42:20 -0600 Subject: [PATCH 05/12] Remove suffix commit --- .../user-preferenced-currency-display.component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 de43b6891e3e..b0e4cdf66a3e 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} /> From df67388d44516e7665aa86f9b08dff52225e2baf Mon Sep 17 00:00:00 2001 From: David Walsh Date: Wed, 13 Nov 2024 19:42:31 -0600 Subject: [PATCH 06/12] Remove unused import --- ui/components/app/assets/token-list/token-list.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/components/app/assets/token-list/token-list.tsx b/ui/components/app/assets/token-list/token-list.tsx index 387c497d45f5..db45d82d4263 100644 --- a/ui/components/app/assets/token-list/token-list.tsx +++ b/ui/components/app/assets/token-list/token-list.tsx @@ -26,7 +26,6 @@ import { filterAssets } from '../util/filter'; import { calculateTokenBalance } from '../util/calculateTokenBalance'; import { calculateTokenFiatAmount } from '../util/calculateTokenFiatAmount'; import { endTrace, TraceName } from '../../../../../shared/lib/trace'; -import { zeroAddress } from 'ethereumjs-util'; type TokenListProps = { onTokenClick: (chainId: string, address: string) => void; From d732ed729bc412692d24fde003bf6985f486a424 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Wed, 13 Nov 2024 20:05:44 -0600 Subject: [PATCH 07/12] Fix test fixtures --- app/scripts/constants/sentry-state.ts | 1 + test/e2e/fixture-builder.js | 3 +++ test/jest/mock-store.js | 1 + 3 files changed, 5 insertions(+) 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/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/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: [ From 6fb4f6adfc9ac98abbf2e8d4021e25b493e754c0 Mon Sep 17 00:00:00 2001 From: David Walsh Date: Wed, 13 Nov 2024 20:15:41 -0600 Subject: [PATCH 08/12] Add optional chaining for calculateTokenBalance --- ui/components/app/assets/util/calculateTokenBalance.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/app/assets/util/calculateTokenBalance.ts b/ui/components/app/assets/util/calculateTokenBalance.ts index 0ecc62eef477..7c7259e7ce31 100644 --- a/ui/components/app/assets/util/calculateTokenBalance.ts +++ b/ui/components/app/assets/util/calculateTokenBalance.ts @@ -34,7 +34,7 @@ export function calculateTokenBalance({ } } else { const hexBalance = - selectedAccountTokenBalancesAcrossChains[chainId]?.[address]; + selectedAccountTokenBalancesAcrossChains?.[chainId]?.[address]; if (hexBalance && hexBalance !== '0x0') { balance = stringifyBalance( new BN(hexToDecimal(hexBalance)), From a4909ff591e04018eaad801882815882046c5e4c Mon Sep 17 00:00:00 2001 From: NidhiKJha Date: Thu, 14 Nov 2024 10:01:43 +0000 Subject: [PATCH 09/12] updated tests in errors.spec.js --- ...rs-after-init-opt-in-background-state.json | 33 ++++++++------ .../errors-after-init-opt-in-ui-state.json | 35 +++++++++------ ...s-before-init-opt-in-background-state.json | 45 ++++++++++--------- .../errors-before-init-opt-in-ui-state.json | 30 +++---------- 4 files changed, 71 insertions(+), 72 deletions(-) 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 bb1640d99365..7b1ce4bc12c2 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 @@ -67,38 +67,38 @@ "srcNetworkAllowlist": { "0": "string", "1": "string", "2": "string" }, "destNetworkAllowlist": { "0": "string", "1": "string", "2": "string" } }, + "srcTokens": {}, + "srcTopAssets": {}, "destTokens": {}, "destTopAssets": {}, "quoteRequest": { - "slippage": 0.5, - "srcTokenAddress": "0x0000000000000000000000000000000000000000" + "srcTokenAddress": "0x0000000000000000000000000000000000000000", + "slippage": 0.5 }, "quotes": {}, - "quotesRefreshCount": 0, - "srcTokens": {}, - "srcTopAssets": {} + "quotesRefreshCount": 0 } }, "CronjobController": { "jobs": "object" }, "CurrencyController": { + "currentCurrency": "usd", "currencyRates": { "ETH": { "conversionDate": "number", "conversionRate": 1700, "usdConversionRate": 1700 }, - "LineaETH": { + "SepoliaETH": { "conversionDate": "number", "conversionRate": 1700, "usdConversionRate": 1700 }, - "SepoliaETH": { + "LineaETH": { "conversionDate": "number", "conversionRate": 1700, "usdConversionRate": 1700 } - }, - "currentCurrency": "usd" + } }, "DecryptMessageController": { "unapprovedDecryptMsgs": "object", @@ -231,10 +231,17 @@ "petnamesEnabled": true, "showMultiRpcModal": "boolean", "isRedesignedConfirmationsDeveloperEnabled": "boolean", - "redesignedConfirmationsEnabled": true, - "redesignedTransactionsEnabled": "boolean", "tokenSortConfig": "object", - "shouldShowAggregatedBalancePopover": "boolean" + "tokenNetworkFilter": { + "0x1": "boolean", + "0xaa36a7": "boolean", + "0xe705": "boolean", + "0xe708": "boolean", + "0x539": "boolean" + }, + "shouldShowAggregatedBalancePopover": "boolean", + "redesignedConfirmationsEnabled": true, + "redesignedTransactionsEnabled": "boolean" }, "ipfsGateway": "string", "isIpfsGatewayEnabled": "boolean", @@ -311,6 +318,7 @@ "swapsFeatureFlags": {} } }, + "TokenBalancesController": { "tokenBalances": "object" }, "TokenListController": { "tokenList": "object", "tokensChainsCache": {}, @@ -327,7 +335,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 3d36d5fc7592..a25b102479b9 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 @@ -35,17 +35,22 @@ "petnamesEnabled": true, "showMultiRpcModal": "boolean", "isRedesignedConfirmationsDeveloperEnabled": "boolean", - "redesignedConfirmationsEnabled": true, - "redesignedTransactionsEnabled": "boolean", "tokenSortConfig": "object", - "showMultiRpcModal": "boolean", - "shouldShowAggregatedBalancePopover": "boolean" + "tokenNetworkFilter": { + "0x1": "boolean", + "0xaa36a7": "boolean", + "0xe705": "boolean", + "0xe708": "boolean", + "0x539": "boolean" + }, + "shouldShowAggregatedBalancePopover": "boolean", + "redesignedConfirmationsEnabled": true, + "redesignedTransactionsEnabled": "boolean" }, "firstTimeFlowType": "import", "completedOnboarding": true, "knownMethodData": "object", "use4ByteResolution": true, - "showIncomingTransactions": "object", "participateInMetaMetrics": true, "dataCollectionForMarketing": "boolean", "nextNonce": null, @@ -55,12 +60,12 @@ "conversionRate": 1700, "usdConversionRate": 1700 }, - "LineaETH": { + "SepoliaETH": { "conversionDate": "number", "conversionRate": 1700, "usdConversionRate": 1700 }, - "SepoliaETH": { + "LineaETH": { "conversionDate": "number", "conversionRate": 1700, "usdConversionRate": 1700 @@ -135,7 +140,6 @@ "forgottenPassword": false, "ipfsGateway": "string", "isIpfsGatewayEnabled": "boolean", - "isMultiAccountBalancesEnabled": "boolean", "useAddressBarEnsResolution": true, "ledgerTransportType": "webhid", "snapRegistryList": "object", @@ -145,6 +149,8 @@ "useTransactionSimulations": true, "enableMV3TimestampSave": true, "useExternalServices": "boolean", + "isMultiAccountBalancesEnabled": "boolean", + "showIncomingTransactions": "object", "metaMetricsId": "fake-metrics-id", "marketingCampaignCookieId": null, "eventsBeforeMetricsOptIn": "object", @@ -182,6 +188,7 @@ "allTokens": {}, "allIgnoredTokens": {}, "allDetectedTokens": {}, + "tokenBalances": "object", "smartTransactionsState": { "fees": {}, "feesByChainId": "object", @@ -229,11 +236,11 @@ "accounts": "object", "accountsByChainId": "object", "marketData": "object", - "signatureRequests": "object", "unapprovedDecryptMsgs": "object", "unapprovedDecryptMsgCount": 0, "unapprovedEncryptionPublicKeyMsgs": "object", "unapprovedEncryptionPublicKeyMsgCount": 0, + "signatureRequests": "object", "unapprovedPersonalMsgs": "object", "unapprovedTypedMessages": "object", "unapprovedPersonalMsgCount": 0, @@ -273,16 +280,16 @@ "srcNetworkAllowlist": { "0": "string", "1": "string", "2": "string" }, "destNetworkAllowlist": { "0": "string", "1": "string", "2": "string" } }, + "srcTokens": {}, + "srcTopAssets": {}, "destTokens": {}, "destTopAssets": {}, "quoteRequest": { - "slippage": 0.5, - "srcTokenAddress": "0x0000000000000000000000000000000000000000" + "srcTokenAddress": "0x0000000000000000000000000000000000000000", + "slippage": 0.5 }, "quotes": {}, - "quotesRefreshCount": 0, - "srcTokens": {}, - "srcTopAssets": {} + "quotesRefreshCount": 0 }, "ensEntries": "object", "ensResolutionsByAddress": "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 fa1a00cbe4ef..fbae3e53463a 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 @@ -50,6 +50,27 @@ }, "snapsInstallPrivacyWarningShown": true }, + "BridgeController": { + "bridgeState": { + "bridgeFeatureFlags": { + "extensionSupport": "boolean", + "srcNetworkAllowlist": { + "0": "string", + "1": "string", + "2": "string" + }, + "destNetworkAllowlist": { + "0": "string", + "1": "string", + "2": "string" + } + }, + "destTokens": {}, + "destTopAssets": {}, + "srcTokens": {}, + "srcTopAssets": {} + } + }, "CurrencyController": { "currentCurrency": "usd", "currencyRates": { @@ -115,10 +136,11 @@ "smartTransactionsOptInStatus": true, "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, + "showMultiRpcModal": "boolean", "isRedesignedConfirmationsDeveloperEnabled": "boolean", "showConfirmationAdvancedDetails": false, "tokenSortConfig": "object", - "showMultiRpcModal": "boolean", + "tokenNetworkFilter": {}, "shouldShowAggregatedBalancePopover": "boolean" }, "selectedAddress": "string", @@ -145,27 +167,6 @@ "smartTransactions": "object" } }, - "BridgeController": { - "bridgeState": { - "bridgeFeatureFlags": { - "extensionSupport": "boolean", - "srcNetworkAllowlist": { - "0": "string", - "1": "string", - "2": "string" - }, - "destNetworkAllowlist": { - "0": "string", - "1": "string", - "2": "string" - } - }, - "destTokens": {}, - "destTopAssets": {}, - "srcTokens": {}, - "srcTopAssets": {} - } - }, "SubjectMetadataController": { "subjectMetadata": "object" }, "TokensController": { "allDetectedTokens": {}, 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..4d3e78f5aa46 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 @@ -64,7 +64,11 @@ "1": "string", "2": "string" } - } + }, + "destTokens": {}, + "destTopAssets": {}, + "srcTokens": {}, + "srcTopAssets": {} } }, "CurrencyController": { @@ -132,10 +136,11 @@ "smartTransactionsOptInStatus": true, "showNativeTokenAsMainBalance": true, "petnamesEnabled": true, + "showMultiRpcModal": "boolean", "isRedesignedConfirmationsDeveloperEnabled": "boolean", "showConfirmationAdvancedDetails": false, "tokenSortConfig": "object", - "showMultiRpcModal": "boolean", + "tokenNetworkFilter": {}, "shouldShowAggregatedBalancePopover": "boolean" }, "selectedAddress": "string", @@ -171,27 +176,6 @@ "ignoredTokens": "object", "tokens": "object" }, - "BridgeController": { - "bridgeState": { - "bridgeFeatureFlags": { - "extensionSupport": "boolean", - "srcNetworkAllowlist": { - "0": "string", - "1": "string", - "2": "string" - }, - "destNetworkAllowlist": { - "0": "string", - "1": "string", - "2": "string" - } - }, - "destTokens": {}, - "destTopAssets": {}, - "srcTokens": {}, - "srcTopAssets": {} - } - }, "TransactionController": { "transactions": "object" }, "config": "object", "firstTimeInfo": "object" From aef0d82e1183f5eda9cb6a1b0e2428d3be89be53 Mon Sep 17 00:00:00 2001 From: NidhiKJha Date: Thu, 14 Nov 2024 10:13:39 +0000 Subject: [PATCH 10/12] fixed tests for /token-sort.spec.ts --- test/e2e/tests/tokens/token-sort.spec.ts | 14 ++++---------- .../asset-list-control-bar.tsx | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) 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/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 9a1ac0163ea7..7abf9564e9c1 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 @@ -101,7 +101,7 @@ const AssetListControlBar = ({ showTokensLinks }: AssetListControlBarProps) => { } > Date: Thu, 14 Nov 2024 12:38:09 +0000 Subject: [PATCH 11/12] show token symbol for native --- .../multichain/token-list-item/token-list-item.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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 81be764c1a7a4c91b0a53b1030e7b1d43a4766a1 Mon Sep 17 00:00:00 2001 From: NidhiKJha Date: Thu, 14 Nov 2024 12:38:31 +0000 Subject: [PATCH 12/12] update privacy view spec --- test/e2e/tests/privacy-mode/privacy-mode.spec.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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();