Skip to content

Commit

Permalink
remove more instances of eth_sign
Browse files Browse the repository at this point in the history
  • Loading branch information
adonesky1 committed Jun 25, 2024
1 parent b0258ad commit bc4c056
Show file tree
Hide file tree
Showing 23 changed files with 1 addition and 172 deletions.
22 changes: 0 additions & 22 deletions .storybook/initial-states/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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: {
Expand Down
4 changes: 0 additions & 4 deletions test/data/mock-send-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@
"methods": [
"personal_sign",
"eth_sendTransaction",
"eth_sign",
"eth_signTransaction",
"eth_signTypedData_v1",
"eth_signTypedData_v2",
Expand All @@ -192,7 +191,6 @@
"methods": [
"personal_sign",
"eth_sendTransaction",
"eth_sign",
"eth_signTransaction",
"eth_signTypedData_v1",
"eth_signTypedData_v2",
Expand All @@ -214,7 +212,6 @@
"methods": [
"personal_sign",
"eth_sendTransaction",
"eth_sign",
"eth_signTransaction",
"eth_signTypedData_v1",
"eth_signTypedData_v2",
Expand All @@ -236,7 +233,6 @@
"methods": [
"personal_sign",
"eth_sendTransaction",
"eth_sign",
"eth_signTransaction",
"eth_signTypedData_v1",
"eth_signTypedData_v2",
Expand Down
6 changes: 0 additions & 6 deletions test/data/mock-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@
"options": {},
"methods": [
"personal_sign",
"eth_sign",
"eth_signTransaction",
"eth_signTypedData_v1",
"eth_signTypedData_v3",
Expand All @@ -437,7 +436,6 @@
"options": {},
"methods": [
"personal_sign",
"eth_sign",
"eth_signTransaction",
"eth_signTypedData_v1",
"eth_signTypedData_v3",
Expand All @@ -457,7 +455,6 @@
"options": {},
"methods": [
"personal_sign",
"eth_sign",
"eth_signTransaction",
"eth_signTypedData_v1",
"eth_signTypedData_v3",
Expand All @@ -477,7 +474,6 @@
"options": {},
"methods": [
"personal_sign",
"eth_sign",
"eth_signTransaction",
"eth_signTypedData_v1",
"eth_signTypedData_v3",
Expand All @@ -497,7 +493,6 @@
"options": {},
"methods": [
"personal_sign",
"eth_sign",
"eth_signTransaction",
"eth_signTypedData_v1",
"eth_signTypedData_v3",
Expand All @@ -521,7 +516,6 @@
"options": {},
"methods": [
"personal_sign",
"eth_sign",
"eth_signTransaction",
"eth_signTypedData_v1",
"eth_signTypedData_v3",
Expand Down
1 change: 0 additions & 1 deletion test/e2e/accounts/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion test/e2e/default-fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ function defaultFixture(inputChainId = CHAIN_IDS.LOCALHOST) {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down
5 changes: 0 additions & 5 deletions test/e2e/fixture-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ class FixtureBuilder {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand All @@ -576,7 +575,6 @@ class FixtureBuilder {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand All @@ -596,7 +594,6 @@ class FixtureBuilder {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down Expand Up @@ -626,7 +623,6 @@ class FixtureBuilder {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand All @@ -647,7 +643,6 @@ class FixtureBuilder {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down
33 changes: 0 additions & 33 deletions test/e2e/snaps/test-snap-siginsights.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
},
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ describe('Unconnected Account Alert', () => {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand All @@ -91,7 +90,6 @@ describe('Unconnected Account Alert', () => {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const mockSelectedAccount = {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export default {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down
1 change: 0 additions & 1 deletion ui/helpers/utils/accounts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ describe('Accounts', () => {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ const render = async ({
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ const render = async (componentProps) => {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 0 additions & 2 deletions ui/pages/confirmations/confirmation/stories/error.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export const TemplateStory = () => {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down Expand Up @@ -205,7 +204,6 @@ export const TemplateOnlyStory = () => {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export const TemplateStory = () => {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down Expand Up @@ -202,7 +201,6 @@ export const TemplateOnlyStory = () => {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down
3 changes: 0 additions & 3 deletions ui/pages/institutional/custody/custody.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ describe('CustodyPage', function () {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand All @@ -119,7 +118,6 @@ describe('CustodyPage', function () {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand All @@ -139,7 +137,6 @@ describe('CustodyPage', function () {
options: {},
methods: [
'personal_sign',
'eth_sign',
'eth_signTransaction',
'eth_signTypedData_v1',
'eth_signTypedData_v3',
Expand Down
5 changes: 0 additions & 5 deletions ui/pages/settings/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit bc4c056

Please sign in to comment.