diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 0160c032ed88..95383c4fb54c 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -3313,15 +3313,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Snaps entdecken" - }, - "openSeaToBlockaidDescription": { - "message": "Sicherheitsbenachrichtigungen sind in diesem Netzwerk nicht mehr verfügbar. Die Installation eines Snaps kann Ihre Sicherheit erhöhen." - }, - "openSeaToBlockaidTitle": { - "message": "Vorsicht!" - }, "operationFailed": { "message": "Vorgang fehlgeschlagen" }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index a53b48a7be40..cdaf57f83bc7 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -3313,15 +3313,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Εξερευνήστε τα Snaps" - }, - "openSeaToBlockaidDescription": { - "message": "Οι ειδοποιήσεις ασφαλείας δεν είναι πλέον διαθέσιμες σε αυτό το δίκτυο. Η εγκατάσταση ενός Snap μπορεί να βελτιώσει την ασφάλειά σας." - }, - "openSeaToBlockaidTitle": { - "message": "Προσοχή!" - }, "operationFailed": { "message": "Η λειτουργία απέτυχε" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 25f3c5436158..b3ee9ef98b53 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -3585,15 +3585,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Explore Snaps" - }, - "openSeaToBlockaidDescription": { - "message": "Security alerts are no longer available on this network. Installing a Snap may improve your security." - }, - "openSeaToBlockaidTitle": { - "message": "Heads up!" - }, "operationFailed": { "message": "Operation Failed" }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index 244c70313634..a0067a6f0464 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -3310,15 +3310,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Explorar Snaps" - }, - "openSeaToBlockaidDescription": { - "message": "Las alertas de seguridad ya no están disponibles en esta red. Instalar un Snap podría mejorar su seguridad." - }, - "openSeaToBlockaidTitle": { - "message": "¡Atención!" - }, "operationFailed": { "message": "Operación fallida" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 1b2a54f3c4c1..98e857113d67 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -3313,15 +3313,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Explorer les Snaps" - }, - "openSeaToBlockaidDescription": { - "message": "Les alertes de sécurité ne sont plus disponibles sur ce réseau. L’installation d’un Snap peut améliorer la sécurité." - }, - "openSeaToBlockaidTitle": { - "message": "Attention !" - }, "operationFailed": { "message": "L’opération a échoué" }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index dc6318004958..6ac05bdf0ef4 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -3310,15 +3310,6 @@ "openSeaNew": { "message": "ओपनसी" }, - "openSeaToBlockaidBtnLabel": { - "message": "Snaps को एक्सप्लोर करें" - }, - "openSeaToBlockaidDescription": { - "message": "सुरक्षा एलर्ट अब इस नेटवर्क पर उपलब्ध नहीं हैं। Snap इंस्टॉल करने से आपकी सुरक्षा में सुधार हो सकता है।" - }, - "openSeaToBlockaidTitle": { - "message": "सतर्क रहें!" - }, "operationFailed": { "message": "प्रचालन नहीं हो पाया" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 0faef246fd39..10811a064ada 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -3313,15 +3313,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Jelajahi Snap" - }, - "openSeaToBlockaidDescription": { - "message": "Peringatan keamanan tidak lagi tersedia di jaringan ini. Menginstal Snap dapat meningkatkan keamanan Anda." - }, - "openSeaToBlockaidTitle": { - "message": "Perhatian!" - }, "operationFailed": { "message": "Pengoperasian Gagal" }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 4308665d7bcb..d8624f6c9263 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -3310,15 +3310,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Snapを閲覧" - }, - "openSeaToBlockaidDescription": { - "message": "このネットワークでセキュリティアラートが使用できなくなりました。Snapをインストールすると、セキュリティが向上する可能性があります。" - }, - "openSeaToBlockaidTitle": { - "message": "ご注意!" - }, "operationFailed": { "message": "操作に失敗しました" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 464c3bf9e250..cde46c43aa8f 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -3310,15 +3310,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Snap 탐색" - }, - "openSeaToBlockaidDescription": { - "message": "이 네트워크에서 더 이상 보안 경고를 사용할 수 없습니다. Snap을 설치하면 보안을 강화할 수 있습니다." - }, - "openSeaToBlockaidTitle": { - "message": "주의하세요!" - }, "operationFailed": { "message": "작업에 실패했습니다" }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index f201f475a4ec..923e4338aaf6 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -3313,15 +3313,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Explorar snaps" - }, - "openSeaToBlockaidDescription": { - "message": "Os alertas de segurança não estão mais disponíveis nesta rede. Instalar um snap pode melhorar sua segurança." - }, - "openSeaToBlockaidTitle": { - "message": "Atenção!" - }, "operationFailed": { "message": "Falha na operação" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 3c419a274034..af5435447c92 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -3313,15 +3313,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Обзор Snaps" - }, - "openSeaToBlockaidDescription": { - "message": "Оповещения безопасности больше не доступны в этой сети. Установка Snap может повысить вашу безопасность." - }, - "openSeaToBlockaidTitle": { - "message": "Внимание!" - }, "operationFailed": { "message": "Операция не удалась" }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index b6d454c012af..e3b1c7853cde 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -3310,15 +3310,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Galugarin ang mga Snap" - }, - "openSeaToBlockaidDescription": { - "message": "Ang mga alerto sa seguridad ay hindi na available sa network na ito. Ang pag-install ng Snap ay maaaring magpahusay sa iyong seguridad." - }, - "openSeaToBlockaidTitle": { - "message": "Paalala!" - }, "operationFailed": { "message": "Nabigo ang Operasyon" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index cd6508892738..4efed1136ce9 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -3313,15 +3313,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Snap'leri Keşfet" - }, - "openSeaToBlockaidDescription": { - "message": "Güvenlik uyarıları artık bu ağda mevcut değil. Bir Snap yüklemek güvenliğinizi artırabilir." - }, - "openSeaToBlockaidTitle": { - "message": "Dikkat!" - }, "operationFailed": { "message": "İşlem Başarısız Oldu" }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index ffc867cf6e76..05edfed2d544 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -3310,15 +3310,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "Khám phá các Snap" - }, - "openSeaToBlockaidDescription": { - "message": "Cảnh báo bảo mật không còn khả dụng trên mạng này. Cài đặt Snap có thể cải thiện khả năng bảo mật của bạn." - }, - "openSeaToBlockaidTitle": { - "message": "Chú ý!" - }, "operationFailed": { "message": "Thao tác thất bại" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 14c8e355be1f..07f5fa4b93d0 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -3310,15 +3310,6 @@ "openSeaNew": { "message": "OpenSea" }, - "openSeaToBlockaidBtnLabel": { - "message": "探索 Snap" - }, - "openSeaToBlockaidDescription": { - "message": "此网络不再提供安全提醒。安装 Snap 可能提高安全性。" - }, - "openSeaToBlockaidTitle": { - "message": "注意!" - }, "operationFailed": { "message": "操作失败" }, diff --git a/app/scripts/controllers/preferences.js b/app/scripts/controllers/preferences.js index 5509d804b6fd..cfa5907a5194 100644 --- a/app/scripts/controllers/preferences.js +++ b/app/scripts/controllers/preferences.js @@ -51,7 +51,6 @@ export default class PreferencesController { eth_sign: false, }, useMultiAccountBalanceChecker: true, - hasDismissedOpenSeaToBlockaidBanner: false, useSafeChainsListValidation: true, // set to true means the dynamic list from the API is being used // set to false will be using the static list from contract-metadata @@ -191,14 +190,6 @@ export default class PreferencesController { this.store.updateState({ useMultiAccountBalanceChecker: val }); } - /** - * Setter for the `dismissOpenSeaToBlockaidBanner` property - * - */ - dismissOpenSeaToBlockaidBanner() { - this.store.updateState({ hasDismissedOpenSeaToBlockaidBanner: true }); - } - /** * Setter for the `useSafeChainsListValidation` property * diff --git a/app/scripts/controllers/preferences.test.js b/app/scripts/controllers/preferences.test.js index fc344ada1264..cd8e9d3fe896 100644 --- a/app/scripts/controllers/preferences.test.js +++ b/app/scripts/controllers/preferences.test.js @@ -308,23 +308,6 @@ describe('preferences controller', () => { }); }); - describe('dismissOpenSeaToBlockaidBanner', () => { - it('hasDismissedOpenSeaToBlockaidBanner should default to false', () => { - expect( - preferencesController.store.getState() - .hasDismissedOpenSeaToBlockaidBanner, - ).toStrictEqual(false); - }); - - it('should set the hasDismissedOpenSeaToBlockaidBanner property in state', () => { - preferencesController.dismissOpenSeaToBlockaidBanner(); - expect( - preferencesController.store.getState() - .hasDismissedOpenSeaToBlockaidBanner, - ).toStrictEqual(true); - }); - }); - describe('setUseSafeChainsListValidation', function () { it('should default to true', function () { const state = preferencesController.store.getState(); diff --git a/app/scripts/lib/setupSentry.js b/app/scripts/lib/setupSentry.js index a6b47eef9376..695b995ddaa8 100644 --- a/app/scripts/lib/setupSentry.js +++ b/app/scripts/lib/setupSentry.js @@ -271,7 +271,6 @@ export const SENTRY_BACKGROUND_STATE = { useRequestQueue: true, useTransactionSimulations: true, enableMV3TimestampSave: true, - hasDismissedOpenSeaToBlockaidBanner: true, }, PushPlatformNotificationsController: { fcmToken: false, diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 88491e2af62c..7550b19e98d6 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -2982,10 +2982,6 @@ export default class MetamaskController extends EventEmitter { preferencesController.setUseMultiAccountBalanceChecker.bind( preferencesController, ), - dismissOpenSeaToBlockaidBanner: - preferencesController.dismissOpenSeaToBlockaidBanner.bind( - preferencesController, - ), setUseSafeChainsListValidation: preferencesController.setUseSafeChainsListValidation.bind( preferencesController, diff --git a/test/e2e/tests/bridge/bridge-click-from-asset-overview.spec.ts b/test/e2e/tests/bridge/bridge-click-from-asset-overview.spec.ts index 24f0bc0fb233..766c4561fd56 100644 --- a/test/e2e/tests/bridge/bridge-click-from-asset-overview.spec.ts +++ b/test/e2e/tests/bridge/bridge-click-from-asset-overview.spec.ts @@ -8,7 +8,8 @@ import { BridgePage, getBridgeFixtures } from './bridge-test-utils'; describe('Click bridge button from asset page @no-mmi', function (this: Suite) { it('loads portfolio tab when flag is turned off', async function () { await withFixtures( - getBridgeFixtures(this.test?.fullTitle()), + // withErc20 param is false, as we test it manually below + getBridgeFixtures(this.test?.fullTitle(), undefined, false), async ({ driver, ganacheServer, diff --git a/test/e2e/tests/bridge/bridge-test-utils.ts b/test/e2e/tests/bridge/bridge-test-utils.ts index 157876f43769..19f9fd8c71c7 100644 --- a/test/e2e/tests/bridge/bridge-test-utils.ts +++ b/test/e2e/tests/bridge/bridge-test-utils.ts @@ -108,15 +108,21 @@ export class BridgePage { export const getBridgeFixtures = ( title?: string, testSpecificMock?: (server: Mockttp) => Promise, + withErc20: boolean = true, ) => { + const fixtureBuilder = new FixtureBuilder({ + inputChainId: CHAIN_IDS.MAINNET, + }).withNetworkControllerOnMainnet(); + + if (withErc20) { + fixtureBuilder.withTokensControllerERC20(); + } + return { driverOptions: { openDevToolsForTabs: true, }, - fixtures: new FixtureBuilder({ inputChainId: CHAIN_IDS.MAINNET }) - .withNetworkControllerOnMainnet() - .withTokensControllerERC20() - .build(), + fixtures: fixtureBuilder.build(), testSpecificMock, smartContract: SMART_CONTRACTS.HST, ganacheOptions: generateGanacheOptions({ 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 a7169143d03e..69e4002b7e46 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 @@ -180,7 +180,6 @@ "dismissSeedBackUpReminder": true, "disabledRpcMethodPreferences": { "eth_sign": false }, "useMultiAccountBalanceChecker": true, - "hasDismissedOpenSeaToBlockaidBanner": false, "useSafeChainsListValidation": "boolean", "useTokenDetection": false, "useNftDetection": false, 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 a79a2e543573..401f92d138a0 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 @@ -114,7 +114,6 @@ "dismissSeedBackUpReminder": true, "disabledRpcMethodPreferences": { "eth_sign": false }, "useMultiAccountBalanceChecker": true, - "hasDismissedOpenSeaToBlockaidBanner": false, "useSafeChainsListValidation": true, "useTokenDetection": false, "useNftDetection": false, diff --git a/test/e2e/tests/ppom/migrate-opensea-to-blockaid-banner.spec.js b/test/e2e/tests/ppom/migrate-opensea-to-blockaid-banner.spec.js deleted file mode 100644 index 77430a250f1e..000000000000 --- a/test/e2e/tests/ppom/migrate-opensea-to-blockaid-banner.spec.js +++ /dev/null @@ -1,81 +0,0 @@ -const FixtureBuilder = require('../../fixture-builder'); -const { - defaultGanacheOptions, - logInWithBalanceValidation, - withFixtures, - openDapp, - WINDOW_TITLES, -} = require('../../helpers'); -const { SMART_CONTRACTS } = require('../../seeder/smart-contracts'); - -describe('Migrate Opensea to Blockaid Banner @no-mmi', function () { - const ONE_CLICK_CONFIRMATIONS_USING_BLOCKAID = [ - { name: 'Personal Sign signature', testDAppBtnId: 'personalSign' }, - { name: 'Sign Typed Data signature', testDAppBtnId: 'signTypedData' }, - { name: 'Sign Typed Data v3 signature', testDAppBtnId: 'signTypedDataV3' }, - { name: 'Sign Typed Data v4 signature', testDAppBtnId: 'signTypedDataV4' }, - { name: 'Sign Permit signature', testDAppBtnId: 'signPermit' }, - { name: 'Simple Send transaction', testDAppBtnId: 'sendButton' }, - { - name: 'Contract Interaction transaction', - testDAppBtnId: 'deployMultisigButton', - }, - ]; - - ONE_CLICK_CONFIRMATIONS_USING_BLOCKAID.forEach((confirmation) => { - it(`Shows up on ${confirmation.name} confirmations`, async function () { - await withFixtures( - { - dapp: true, - fixtures: new FixtureBuilder() - .withPreferencesController({ - hasMigratedFromOpenSeaToBlockaid: true, - }) - .withPermissionControllerConnectedToTestDapp() - .build(), - ganacheOptions: defaultGanacheOptions, - title: this.test.fullTitle(), - }, - async ({ driver, ganacheServer }) => { - await logInWithBalanceValidation(driver, ganacheServer); - await openDapp(driver); - - await driver.clickElement(`#${confirmation.testDAppBtnId}`); - await driver.delay(2000); - - await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); - await driver.waitForSelector({ text: 'Heads up!', tag: 'p' }); - }, - ); - }); - }); - - it('Shows up on Token Approval transaction confirmations', async function () { - const smartContract = SMART_CONTRACTS.HST; - await withFixtures( - { - dapp: true, - fixtures: new FixtureBuilder() - .withPreferencesController({ hasMigratedFromOpenSeaToBlockaid: true }) - .withPermissionControllerConnectedToTestDapp() - .build(), - ganacheOptions: defaultGanacheOptions, - smartContract, - title: this.test.fullTitle(), - }, - async ({ driver, contractRegistry, ganacheServer }) => { - const contractAddress = await contractRegistry.getContractAddress( - smartContract, - ); - await logInWithBalanceValidation(driver, ganacheServer); - await openDapp(driver, contractAddress); - - await driver.clickElement({ text: 'Approve Tokens', tag: 'button' }); - await driver.delay(2000); - - await driver.switchToWindowWithTitle(WINDOW_TITLES.Dialog); - await driver.waitForSelector({ text: 'Heads up!', tag: 'p' }); - }, - ); - }); -}); diff --git a/ui/components/app/snaps/snap-authorship-expanded/snap-authorship-expanded.js b/ui/components/app/snaps/snap-authorship-expanded/snap-authorship-expanded.js index 8ab9c3a299ca..5339c8587d52 100644 --- a/ui/components/app/snaps/snap-authorship-expanded/snap-authorship-expanded.js +++ b/ui/components/app/snaps/snap-authorship-expanded/snap-authorship-expanded.js @@ -16,6 +16,7 @@ import { FontWeight, JustifyContent, OverflowWrap, + TextAlign, TextColor, TextVariant, } from '../../../../helpers/constants/design-system'; @@ -179,7 +180,7 @@ const SnapAuthorshipExpanded = ({ snapId, className, snap }) => { flexDirection={FlexDirection.Column} alignItems={AlignItems.flexEnd} > - {installOrigin.host} + {installOrigin.host} {t('installedOn', [ formatDate(installInfo.date, 'dd MMM yyyy'), diff --git a/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/__snapshots__/blockaid-unavailable-banner-alert.test.tsx.snap b/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/__snapshots__/blockaid-unavailable-banner-alert.test.tsx.snap deleted file mode 100644 index 780135bc2132..000000000000 --- a/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/__snapshots__/blockaid-unavailable-banner-alert.test.tsx.snap +++ /dev/null @@ -1,50 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` should not render if user hasn't been migrated to blockaid 1`] = `
`; - -exports[` should render if user has been migrated to blockaid 1`] = ` -
-
- -
-

- Heads up! -

-

- Security alerts are no longer available on this network. Installing a Snap may improve your security. -

-

- - Explore Snaps - -

- -
-
-`; diff --git a/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert.stories.tsx b/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert.stories.tsx deleted file mode 100644 index bbb1752a9da3..000000000000 --- a/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert.stories.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -import { BlockaidUnavailableBannerAlert } from './blockaid-unavailable-banner-alert'; - -export default { - title: 'Components/App/Confirm/BlockaidUnavailableBannerAlert', -}; - -export const DefaultStory = () => ; - -DefaultStory.storyName = 'Default'; diff --git a/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert.test.tsx b/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert.test.tsx deleted file mode 100644 index dffe59df0211..000000000000 --- a/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert.test.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import * as React from 'react'; -import mockState from '../../../../../test/data/mock-state.json'; -import configureStore from '../../../../store/store'; -import { renderWithProvider } from '../../../../../test/lib/render-helpers'; -import { BlockaidUnavailableBannerAlert } from './blockaid-unavailable-banner-alert'; - -describe('', () => { - beforeEach(() => { - jest.resetAllMocks(); - }); - - // TODO: Replace `any` with type - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const render = (storeOverrides: Record = {}) => { - const store = configureStore({ - ...mockState.metamask, - metamask: { ...mockState.metamask }, - ...storeOverrides, - }); - - return renderWithProvider(, store); - }; - - it("should not render if user hasn't been migrated to blockaid", () => { - const { container } = render(); - - expect(container).toMatchSnapshot(); - }); - - it('should render if user has been migrated to blockaid', () => { - const { container } = render({ - metamask: { - hasMigratedFromOpenSeaToBlockaid: true, - }, - }); - - expect(container).toMatchSnapshot(); - }); -}); diff --git a/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert.tsx b/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert.tsx deleted file mode 100644 index e7d5b254b477..000000000000 --- a/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import React from 'react'; -import { useDispatch, useSelector } from 'react-redux'; -import { - BannerAlert, - BannerAlertSeverity, -} from '../../../../components/component-library'; -import { useI18nContext } from '../../../../hooks/useI18nContext'; -import { - getHasDismissedOpenSeaToBlockaidBanner, - getHasMigratedFromOpenSeaToBlockaid, - getIsNetworkSupportedByBlockaid, -} from '../../../../selectors'; -import { dismissOpenSeaToBlockaidBanner } from '../../../../store/actions'; - -export const BlockaidUnavailableBannerAlert = () => { - const dispatch = useDispatch(); - const t = useI18nContext(); - - const hasMigratedFromOpenSeaToBlockaid = useSelector( - getHasMigratedFromOpenSeaToBlockaid, - ); - const isNetworkSupportedByBlockaid = useSelector( - getIsNetworkSupportedByBlockaid, - ); - const hasDismissedOpenSeaToBlockaidBanner = useSelector( - getHasDismissedOpenSeaToBlockaidBanner, - ); - - const showOpenSeaToBlockaidBannerAlert = - hasMigratedFromOpenSeaToBlockaid && - !isNetworkSupportedByBlockaid && - !hasDismissedOpenSeaToBlockaidBanner; - - const handleCloseOpenSeaToBlockaidBannerAlert = () => { - dispatch(dismissOpenSeaToBlockaidBanner()); - }; - - return showOpenSeaToBlockaidBannerAlert ? ( - - ) : null; -}; diff --git a/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/index.ts b/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/index.ts deleted file mode 100644 index c8ceb0873461..000000000000 --- a/ui/pages/confirmations/components/blockaid-unavailable-banner-alert/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { BlockaidUnavailableBannerAlert } from './blockaid-unavailable-banner-alert'; diff --git a/ui/pages/confirmations/components/signature-request-original/signature-request-original.component.js b/ui/pages/confirmations/components/signature-request-original/signature-request-original.component.js index dbf451e0ff6f..b6e934a2cbea 100644 --- a/ui/pages/confirmations/components/signature-request-original/signature-request-original.component.js +++ b/ui/pages/confirmations/components/signature-request-original/signature-request-original.component.js @@ -50,7 +50,6 @@ import SignatureRequestHeader from '../signature-request-header'; import SnapLegacyAuthorshipHeader from '../../../../components/app/snaps/snap-legacy-authorship-header'; import InsightWarnings from '../../../../components/app/snaps/insight-warnings'; import { BlockaidResultType } from '../../../../../shared/constants/security-provider'; -import { BlockaidUnavailableBannerAlert } from '../blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert'; import SignatureRequestOriginalWarning from './signature-request-original-warning'; export default class SignatureRequestOriginal extends Component { @@ -151,7 +150,6 @@ export default class SignatureRequestOriginal extends Component { securityProviderResponse={txData.securityProviderResponse} /> )} - { ///: BEGIN:ONLY_INCLUDE_IF(build-mmi) this.props.selectedAccount.address === diff --git a/ui/pages/confirmations/components/signature-request/signature-request.js b/ui/pages/confirmations/components/signature-request/signature-request.js index fc812ef54634..d1a04c9c9c67 100644 --- a/ui/pages/confirmations/components/signature-request/signature-request.js +++ b/ui/pages/confirmations/components/signature-request/signature-request.js @@ -78,7 +78,6 @@ import { useMMICustodySignMessage } from '../../../../hooks/useMMICustodySignMes ///: END:ONLY_INCLUDE_IF import BlockaidBannerAlert from '../security-provider-banner-alert/blockaid-banner-alert/blockaid-banner-alert'; import InsightWarnings from '../../../../components/app/snaps/insight-warnings'; -import { BlockaidUnavailableBannerAlert } from '../blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert'; import Message from './signature-request-message'; import Footer from './signature-request-footer'; @@ -212,7 +211,6 @@ const SignatureRequest = ({ txData, warnings }) => { marginRight={4} marginBottom={4} /> - {(txData?.securityProviderResponse?.flagAsDangerous !== undefined && txData?.securityProviderResponse?.flagAsDangerous !== SECURITY_PROVIDER_MESSAGE_SEVERITY.NOT_MALICIOUS) || diff --git a/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.component.js b/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.component.js index 84c81acc7ccd..ca9e80fed643 100644 --- a/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.component.js +++ b/ui/pages/confirmations/confirm-transaction-base/confirm-transaction-base.component.js @@ -69,7 +69,6 @@ import { isHardwareKeyring } from '../../../helpers/utils/hardware'; import FeeDetailsComponent from '../components/fee-details-component/fee-details-component'; import { SimulationDetails } from '../components/simulation-details'; import { fetchSwapsFeatureFlags } from '../../swaps/swaps.util'; -import { BlockaidUnavailableBannerAlert } from '../components/blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert'; export default class ConfirmTransactionBase extends Component { static contextTypes = { @@ -534,7 +533,6 @@ export default class ConfirmTransactionBase extends Component { return (
- diff --git a/ui/pages/confirmations/token-allowance/token-allowance.js b/ui/pages/confirmations/token-allowance/token-allowance.js index 56519615e00c..c091d390075e 100644 --- a/ui/pages/confirmations/token-allowance/token-allowance.js +++ b/ui/pages/confirmations/token-allowance/token-allowance.js @@ -72,7 +72,6 @@ import { ConfirmPageContainerWarning } from '../components/confirm-page-containe import CustomNonce from '../components/custom-nonce'; import FeeDetailsComponent from '../components/fee-details-component/fee-details-component'; import { BlockaidResultType } from '../../../../shared/constants/security-provider'; -import { BlockaidUnavailableBannerAlert } from '../components/blockaid-unavailable-banner-alert/blockaid-unavailable-banner-alert'; const ALLOWED_HOSTS = ['portfolio.metamask.io']; @@ -385,7 +384,6 @@ export default function TokenAllowance({ marginLeft={4} marginRight={4} /> - {isSuspiciousResponse(txData?.securityProviderResponse) && ( { - return (dispatch: MetaMaskReduxDispatch) => { - // skipping loading indication as it blips in the UI and looks weird - log.debug(`background.dismissOpenSeaToBlockaidBanner`); - callBackgroundMethod('dismissOpenSeaToBlockaidBanner', [], (err) => { - if (err) { - dispatch(displayWarning(err)); - } - }); - }; -} - export function setUseSafeChainsListValidation( val: boolean, ): ThunkAction {