From bc4c0560c67c63ad478e698afeec140bba2dbed5 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 23 May 2024 15:31:31 -0500 Subject: [PATCH] remove more instances of eth_sign --- .storybook/initial-states/transactions.js | 22 --------- test/data/mock-send-state.json | 4 -- test/data/mock-state.json | 6 --- test/e2e/accounts/common.ts | 1 - test/e2e/default-fixture.js | 1 - test/e2e/fixture-builder.js | 5 -- test/e2e/snaps/test-snap-siginsights.spec.js | 33 ------------- .../unconnected-account-alert.test.js | 2 - .../selected-account-component.test.js | 1 - .../transaction-list-item.stories.js | 7 --- .../account-list-item-menu.stories.js | 1 - ui/helpers/utils/accounts.test.js | 1 - .../edit-gas-item/edit-gas-item.test.js | 1 - .../edit-gas-tooltip/edit-gas-tooltip.test.js | 1 - .../signature-request-original.stories.js | 15 ------ .../confirmation/stories/error.stories.js | 2 - .../confirmation/stories/success.stories.js | 2 - .../institutional/custody/custody.test.js | 3 -- ui/pages/settings/index.scss | 5 -- ui/selectors/selectors.test.js | 9 +--- ui/selectors/transactions.test.js | 48 ------------------- ui/store/actionConstants.test.js | 1 - ui/store/actions.test.js | 2 - 23 files changed, 1 insertion(+), 172 deletions(-) diff --git a/.storybook/initial-states/transactions.js b/.storybook/initial-states/transactions.js index 6dd76b2be7e8..f7d81759770e 100644 --- a/.storybook/initial-states/transactions.js +++ b/.storybook/initial-states/transactions.js @@ -7,7 +7,6 @@ const MOCK_TX_TYPE = { INCOMING: 'incoming', PERSONAL_SIGN: 'personal_sign', RETRY: 'retry', - SIGN: 'eth_sign', SIGN_TYPED_DATA: 'eth_signTypedData', SIMPLE_SEND: 'simpleSend', SMART: 'smart', @@ -420,27 +419,6 @@ export const MOCK_TRANSACTION_BY_TYPE = { 'Error: [ethjs-query] while formatting outputs from RPC \'{"value":{"code":-32000,"message":"replacement transaction underpriced"}}\'\n at chrome-extension://hbljfohiafgaaaabejngpgolnboohpaf/common-5.js:14346:29', }, }, - [MOCK_TX_TYPE.SIGN]: { - id: 5177046356058675, - msgParams: { - from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e', - data: - '0x879a053d4800c6354e76c7985a865d2922c82fb5b3f4577b2fe08b998954f2e0', - origin: 'https://metamask.github.io', - }, - txParams: { - from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb', - gas: '0x5208', - gasPrice: '0x77359400', - nonce: '0x3', - value: '0x00', - data: - '0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029', - }, - time: 1653451051909, - status: 'unapproved', - type: 'eth_sign', - }, [MOCK_TX_TYPE.SIGN_TYPED_DATA]: { id: 5177046356058598, msgParams: { diff --git a/test/data/mock-send-state.json b/test/data/mock-send-state.json index f2e89766a207..e36ea8b4ce97 100644 --- a/test/data/mock-send-state.json +++ b/test/data/mock-send-state.json @@ -170,7 +170,6 @@ "methods": [ "personal_sign", "eth_sendTransaction", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v2", @@ -192,7 +191,6 @@ "methods": [ "personal_sign", "eth_sendTransaction", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v2", @@ -214,7 +212,6 @@ "methods": [ "personal_sign", "eth_sendTransaction", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v2", @@ -236,7 +233,6 @@ "methods": [ "personal_sign", "eth_sendTransaction", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v2", diff --git a/test/data/mock-state.json b/test/data/mock-state.json index 920533023a58..0f4e9258c049 100644 --- a/test/data/mock-state.json +++ b/test/data/mock-state.json @@ -417,7 +417,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -437,7 +436,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -457,7 +455,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -477,7 +474,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -497,7 +493,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", @@ -521,7 +516,6 @@ "options": {}, "methods": [ "personal_sign", - "eth_sign", "eth_signTransaction", "eth_signTypedData_v1", "eth_signTypedData_v3", diff --git a/test/e2e/accounts/common.ts b/test/e2e/accounts/common.ts index f5be90564143..4b080248b779 100644 --- a/test/e2e/accounts/common.ts +++ b/test/e2e/accounts/common.ts @@ -19,7 +19,6 @@ import { retry } from '../../../development/lib/retry'; /** * These are fixtures specific to Account Snap E2E tests: * -- connected to Test Dapp - * -- eth_sign enabled * -- two private keys with 25 ETH each * * @param title diff --git a/test/e2e/default-fixture.js b/test/e2e/default-fixture.js index 1ffe75134970..726430ae8736 100644 --- a/test/e2e/default-fixture.js +++ b/test/e2e/default-fixture.js @@ -41,7 +41,6 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index 7bc15af41969..fdfd75f8e56e 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -555,7 +555,6 @@ class FixtureBuilder { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -576,7 +575,6 @@ class FixtureBuilder { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -596,7 +594,6 @@ class FixtureBuilder { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -626,7 +623,6 @@ class FixtureBuilder { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -647,7 +643,6 @@ class FixtureBuilder { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/test/e2e/snaps/test-snap-siginsights.spec.js b/test/e2e/snaps/test-snap-siginsights.spec.js index 6b43551ac182..3b5090313e79 100644 --- a/test/e2e/snaps/test-snap-siginsights.spec.js +++ b/test/e2e/snaps/test-snap-siginsights.spec.js @@ -222,39 +222,6 @@ describe('Test Snap Signature Insights', function () { text: '0xcd2f9c55840f5e1bcf61812e93c1932485b524ca673b36355482a4fbdf52f692684f92b4f4ab6f6c8572dacce46bd107da154be1c06939b855ecce57a1616ba71b', tag: 'span', }); - - // TEST FIVE: eth_sign - - // scroll to and click eth sign button - const ethSignButton1 = await driver.findElement('#ethSign'); - await driver.scrollToElement(ethSignButton1); - await driver.clickElement('#ethSign'); - - // switch back to MetaMask window and switch to tx insights pane - await switchToNotificationWindow(driver, 4); - - // wait for and click sign - await clickSignOnSignatureConfirmation({ - driver, - snapSigInsights: true, - locatorID: '#ethSign', - }); - - // wait for and click signature warning sign button - // click checkbox to authorize signing - await driver.clickElement('.mm-checkbox__input-wrapper'); - - // click sign button - await driver.clickElement('[data-testid="snapInsightsButtonConfirm"]'); - - // switch back to test-dapp window - await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp); - - // check results of test - await driver.waitForSelector({ - text: '"0x816ab6c5d5356548cc4e004ef35a37fdfab916742a2bbeda756cd064c3d3789a6557d41d49549be1de249e1937a8d048996dfcc70d0552111605dc7cc471e8531b"', - tag: 'span', - }); }, ); }); diff --git a/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js b/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js index be95cef4a70f..4a3a948aa489 100644 --- a/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js +++ b/ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.test.js @@ -71,7 +71,6 @@ describe('Unconnected Account Alert', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -91,7 +90,6 @@ describe('Unconnected Account Alert', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/components/app/selected-account/selected-account-component.test.js b/ui/components/app/selected-account/selected-account-component.test.js index a48e24a661c6..2f03b036ec29 100644 --- a/ui/components/app/selected-account/selected-account-component.test.js +++ b/ui/components/app/selected-account/selected-account-component.test.js @@ -24,7 +24,6 @@ const mockSelectedAccount = { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/components/app/transaction-list-item/transaction-list-item.stories.js b/ui/components/app/transaction-list-item/transaction-list-item.stories.js index ef4b0567fc27..25afe1e12693 100644 --- a/ui/components/app/transaction-list-item/transaction-list-item.stories.js +++ b/ui/components/app/transaction-list-item/transaction-list-item.stories.js @@ -135,13 +135,6 @@ PersonalSign.args = { }, }; -Sign.storyName = 'eth_sign'; -Sign.args = { - 'transactionGroup.primaryTransaction': { - ...MOCK_TRANSACTION_BY_TYPE[TransactionType.sign], - }, -}; - SignTypeData.storyName = 'eth_signTypedData'; SignTypeData.args = { 'transactionGroup.primaryTransaction': { diff --git a/ui/components/multichain/account-list-item-menu/account-list-item-menu.stories.js b/ui/components/multichain/account-list-item-menu/account-list-item-menu.stories.js index dda7fd811e18..be27b4827d80 100644 --- a/ui/components/multichain/account-list-item-menu/account-list-item-menu.stories.js +++ b/ui/components/multichain/account-list-item-menu/account-list-item-menu.stories.js @@ -38,7 +38,6 @@ export default { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/helpers/utils/accounts.test.js b/ui/helpers/utils/accounts.test.js index 3c71641396ca..e284ad886f56 100644 --- a/ui/helpers/utils/accounts.test.js +++ b/ui/helpers/utils/accounts.test.js @@ -105,7 +105,6 @@ describe('Accounts', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-item/edit-gas-item.test.js b/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-item/edit-gas-item.test.js index a2b1fe272160..c0c51d260e7a 100644 --- a/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-item/edit-gas-item.test.js +++ b/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-item/edit-gas-item.test.js @@ -107,7 +107,6 @@ const render = async ({ options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.test.js b/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.test.js index fe465030409e..6d34b64ac371 100644 --- a/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.test.js +++ b/ui/pages/confirmations/components/edit-gas-fee-popover/edit-gas-tooltip/edit-gas-tooltip.test.js @@ -64,7 +64,6 @@ const render = async (componentProps) => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/confirmations/components/signature-request-original/signature-request-original.stories.js b/ui/pages/confirmations/components/signature-request-original/signature-request-original.stories.js index b02506e7e462..fed4d1b9cc28 100644 --- a/ui/pages/confirmations/components/signature-request-original/signature-request-original.stories.js +++ b/ui/pages/confirmations/components/signature-request-original/signature-request-original.stories.js @@ -97,21 +97,6 @@ DefaultStory.args = { }, }; -export const ETHSignStory = Template.bind({}); - -ETHSignStory.storyName = 'eth_sign Type'; - -ETHSignStory.args = { - txData: { - msgParams: { - from: '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e', - data: MOCK_SIGN_DATA, - origin: 'https://happydapp.website/governance?futarchy=true', - }, - type: MESSAGE_TYPE.ETH_SIGN, - }, -}; - export const ETHSignTypedStory = Template.bind({}); ETHSignTypedStory.storyName = 'eth_signTypedData Type'; diff --git a/ui/pages/confirmations/confirmation/stories/error.stories.js b/ui/pages/confirmations/confirmation/stories/error.stories.js index dd6fab018425..1dc3bc348641 100644 --- a/ui/pages/confirmations/confirmation/stories/error.stories.js +++ b/ui/pages/confirmations/confirmation/stories/error.stories.js @@ -128,7 +128,6 @@ export const TemplateStory = () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -205,7 +204,6 @@ export const TemplateOnlyStory = () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/confirmations/confirmation/stories/success.stories.js b/ui/pages/confirmations/confirmation/stories/success.stories.js index bf768a606d10..bf45f42431e7 100644 --- a/ui/pages/confirmations/confirmation/stories/success.stories.js +++ b/ui/pages/confirmations/confirmation/stories/success.stories.js @@ -126,7 +126,6 @@ export const TemplateStory = () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -202,7 +201,6 @@ export const TemplateOnlyStory = () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/institutional/custody/custody.test.js b/ui/pages/institutional/custody/custody.test.js index f58183a1ee0f..eabd2f8f521e 100644 --- a/ui/pages/institutional/custody/custody.test.js +++ b/ui/pages/institutional/custody/custody.test.js @@ -99,7 +99,6 @@ describe('CustodyPage', function () { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -119,7 +118,6 @@ describe('CustodyPage', function () { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -139,7 +137,6 @@ describe('CustodyPage', function () { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/pages/settings/index.scss b/ui/pages/settings/index.scss index 053675326c7f..48e12e8adebc 100644 --- a/ui/pages/settings/index.scss +++ b/ui/pages/settings/index.scss @@ -367,11 +367,6 @@ @include design-system.screen-sm-max { max-width: 100%; } - - .eth-sign-toggle .toggle-button__status { - // for eth_sign we need to override the uppercase property of toggle button text - text-transform: capitalize; - } } &__button { diff --git a/ui/selectors/selectors.test.js b/ui/selectors/selectors.test.js index 68897323aa6f..cf8af7663d40 100644 --- a/ui/selectors/selectors.test.js +++ b/ui/selectors/selectors.test.js @@ -259,7 +259,7 @@ describe('Selectors', () => { }, time: 1, status: TransactionStatus.unapproved, - type: 'eth_sign', + type: 'eth_signTypedData', }, }, }, @@ -855,7 +855,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1540,7 +1539,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1565,7 +1563,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1589,7 +1586,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1615,7 +1611,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1643,7 +1638,6 @@ describe('Selectors', () => { }, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -1666,7 +1660,6 @@ describe('Selectors', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/selectors/transactions.test.js b/ui/selectors/transactions.test.js index 4339cb8bdbed..13ab21727ec4 100644 --- a/ui/selectors/transactions.test.js +++ b/ui/selectors/transactions.test.js @@ -27,54 +27,6 @@ import { describe('Transaction Selectors', () => { describe('unapprovedMessagesSelector', () => { - it('returns eth sign msg from unapprovedMsgs', () => { - const msg = { - id: 1, - msgParams: { - from: '0xAddress', - data: '0xData', - origin: 'origin', - }, - time: 1, - status: TransactionStatus.unapproved, - type: 'eth_sign', - }; - - const state = { - metamask: { - unapprovedMsgs: { - 1: msg, - }, - providerConfig: { - chainId: '0x5', - }, - internalAccounts: { - accounts: { - 'cf8dace4-9439-4bd4-b3a8-88c821c8fcb3': { - address: '0xAddress', - id: 'cf8dace4-9439-4bd4-b3a8-88c821c8fcb3', - metadata: { - name: 'Test Account', - keyring: { - type: 'HD Key Tree', - }, - }, - options: {}, - methods: ETH_EOA_METHODS, - type: EthAccountType.Eoa, - }, - }, - selectedAccount: 'cf8dace4-9439-4bd4-b3a8-88c821c8fcb3', - }, - }, - }; - - const msgSelector = unapprovedMessagesSelector(state); - - expect(Array.isArray(msgSelector)).toStrictEqual(true); - expect(msgSelector).toStrictEqual([msg]); - }); - it('returns personal sign from unapprovedPersonalMsgsSelector', () => { const msg = { id: 1, diff --git a/ui/store/actionConstants.test.js b/ui/store/actionConstants.test.js index b065b03ea91e..e74e4f78dc2a 100644 --- a/ui/store/actionConstants.test.js +++ b/ui/store/actionConstants.test.js @@ -21,7 +21,6 @@ describe('Redux actionConstants', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', diff --git a/ui/store/actions.test.js b/ui/store/actions.test.js index 813153d33ca3..4e2723688bb4 100644 --- a/ui/store/actions.test.js +++ b/ui/store/actions.test.js @@ -819,7 +819,6 @@ describe('Actions', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3', @@ -867,7 +866,6 @@ describe('Actions', () => { options: {}, methods: [ 'personal_sign', - 'eth_sign', 'eth_signTransaction', 'eth_signTypedData_v1', 'eth_signTypedData_v3',