Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove eth-sign #11246

Merged
merged 10 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions app/actions/rpcEvents/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ describe('action, rpcEvents', () => {
describe('setEventStage', () => {
const createExpectedAction = (eventStage: RPCStageTypes) => ({
type: ActionType.SET_EVENT_STAGE,
rpcName: 'eth_sign',
rpcName: 'eth_signTypedData',
eventStage,
});

it('should create an action to set event stage to REQUEST_SENT', () => {
expect(setEventStage('eth_sign', RPCStageTypes.REQUEST_SEND)).toEqual(
expect(setEventStage('eth_signTypedData', RPCStageTypes.REQUEST_SEND)).toEqual(
createExpectedAction(RPCStageTypes.REQUEST_SEND),
);
});

it('should create an action to set event stage to COMPLETE', () => {
expect(setEventStage('eth_sign', RPCStageTypes.COMPLETE)).toEqual(
expect(setEventStage('eth_signTypedData', RPCStageTypes.COMPLETE)).toEqual(
createExpectedAction(RPCStageTypes.COMPLETE),
);
});
Expand All @@ -31,21 +31,21 @@ describe('action, rpcEvents', () => {
it('should create an action to reset the event stage', () => {
const expectedAction = {
type: ActionType.RESET_EVENT_STATE,
rpcName: 'eth_sign',
rpcName: 'eth_signTypedData',
};
expect(resetEventStage('eth_sign')).toEqual(expectedAction);
expect(resetEventStage('eth_signTypedData')).toEqual(expectedAction);
});
});

describe('setEventStageError', () => {
it('should create an action to set the event stage error', () => {
const expectedAction = {
type: ActionType.SET_EVENT_ERROR,
rpcName: 'eth_sign',
rpcName: 'eth_signTypedData',
eventStage: RPCStageTypes.ERROR,
error: new Error('test error'),
};
expect(setEventStageError('eth_sign', new Error('test error'))).toEqual(
expect(setEventStageError('eth_signTypedData', new Error('test error'))).toEqual(
expectedAction,
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ describe('SignatureApproval', () => {
jest.resetAllMocks();
});

it.each([
ApprovalTypes.ETH_SIGN,
ApprovalTypes.PERSONAL_SIGN,
ApprovalTypes.ETH_SIGN_TYPED_DATA,
])(
it.each([ApprovalTypes.PERSONAL_SIGN, ApprovalTypes.ETH_SIGN_TYPED_DATA])(
'populates message params if approval type is %s',
(approvalType: string) => {
mockApprovalRequest({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ const SignatureApproval = () => {

const messageParams =
approvalRequest &&
[
ApprovalTypes.ETH_SIGN,
ApprovalTypes.PERSONAL_SIGN,
ApprovalTypes.ETH_SIGN_TYPED_DATA,
].includes(approvalRequest.type as ApprovalTypes)
[ApprovalTypes.PERSONAL_SIGN, ApprovalTypes.ETH_SIGN_TYPED_DATA].includes(
approvalRequest.type as ApprovalTypes,
)
? approvalRequest?.requestData
: undefined;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`SignatureApproval populates message params if approval type is eth_sign 1`] = `
<Root
approvalType="eth_sign"
messageParams={
{
"test": "value",
}
}
onSignConfirm={[Function]}
/>
`;

exports[`SignatureApproval populates message params if approval type is eth_signTypedData 1`] = `
<Root
approvalType="eth_signTypedData"
Expand Down
5 changes: 0 additions & 5 deletions app/components/Nav/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
import LedgerMessageSignModal from '../../UI/LedgerModals/LedgerMessageSignModal';
import LedgerTransactionModal from '../../UI/LedgerModals/LedgerTransactionModal';
import AccountActions from '../../../components/Views/AccountActions';
import EthSignFriction from '../../../components/Views/Settings/AdvancedSettings/EthSignFriction';
import FiatOnTestnetsFriction from '../../../components/Views/Settings/AdvancedSettings/FiatOnTestnetsFriction';
import WalletActions from '../../Views/WalletActions';
import NetworkSelector from '../../../components/Views/NetworkSelector';
Expand Down Expand Up @@ -585,7 +584,7 @@
return null;
};

const DetectedTokensFlow = () => (

Check warning on line 587 in app/components/Nav/App/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint)

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “App” and pass data as props
<Stack.Navigator
mode={'modal'}
screenOptions={clearStackNavigatorOptions}
Expand All @@ -599,7 +598,7 @@
</Stack.Navigator>
);

const RootModalFlow = () => (

Check warning on line 601 in app/components/Nav/App/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint)

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “App” and pass data as props
<Stack.Navigator mode={'modal'} screenOptions={clearStackNavigatorOptions}>
<Stack.Screen
name={Routes.MODAL.WALLET_ACTIONS}
Expand Down Expand Up @@ -706,10 +705,6 @@
name={Routes.SHEET.ACCOUNT_ACTIONS}
component={AccountActions}
/>
<Stack.Screen
name={Routes.SHEET.ETH_SIGN_FRICTION}
component={EthSignFriction}
/>
<Stack.Screen
name={Routes.SHEET.FIAT_ON_TESTNETS_FRICTION}
component={FiatOnTestnetsFriction}
Expand Down Expand Up @@ -742,7 +737,7 @@
</Stack.Navigator>
);

const ImportPrivateKeyView = () => (

Check warning on line 740 in app/components/Nav/App/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint)

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “App” and pass data as props
<Stack.Navigator
screenOptions={{
headerShown: false,
Expand All @@ -763,7 +758,7 @@
</Stack.Navigator>
);

const ConnectQRHardwareFlow = () => (

Check warning on line 761 in app/components/Nav/App/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint)

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “App” and pass data as props
<Stack.Navigator
screenOptions={{
headerShown: false,
Expand All @@ -773,7 +768,7 @@
</Stack.Navigator>
);

const LedgerConnectFlow = () => (

Check warning on line 771 in app/components/Nav/App/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint)

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “App” and pass data as props
<Stack.Navigator
screenOptions={{
headerShown: false,
Expand All @@ -787,7 +782,7 @@
</Stack.Navigator>
);

const ConnectHardwareWalletFlow = () => (

Check warning on line 785 in app/components/Nav/App/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint)

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “App” and pass data as props
<Stack.Navigator name="ConnectHardwareWallet">
<Stack.Screen
name={Routes.HW.SELECT_DEVICE}
Expand All @@ -797,14 +792,14 @@
</Stack.Navigator>
);

const EditAccountNameFlow = () => (

Check warning on line 795 in app/components/Nav/App/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint)

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “App” and pass data as props
<Stack.Navigator>
<Stack.Screen name="EditAccountName" component={EditAccountName} />
</Stack.Navigator>
);

// eslint-disable-next-line react/prop-types
const AddNetworkFlow = ({ route }) => (

Check warning on line 802 in app/components/Nav/App/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint)

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “App” and pass data as props
<Stack.Navigator>
<Stack.Screen
name="AddNetwork"
Expand Down
6 changes: 0 additions & 6 deletions app/components/UI/AssetIcon/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ const mockInitialState = {
displayNftMedia: true,
useSafeChainsListValidation: false,
isMultiAccountBalancesEnabled: true,
disabledRpcMethodPreferences: {
eth_sign: false,
},
showTestNetworks: true,
_U: 0,
_V: 1,
Expand All @@ -35,9 +32,6 @@ const mockInitialState = {
displayNftMedia: true,
useSafeChainsListValidation: false,
isMultiAccountBalancesEnabled: true,
disabledRpcMethodPreferences: {
eth_sign: false,
},
showTestNetworks: true,
showIncomingTransactions: {
'0x1': true,
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading