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: removing the multichain feature flag, and corresponding dead code #12831

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f901821
chore: toggling the chain permissions feature flags so they are alway…
EtherWizard33 Dec 25, 2024
294e637
chore: remove MC FF OFF code (dead code) from NetworkVerificationInfo…
EtherWizard33 Dec 25, 2024
243fa36
chore: remove MC FF OFF code (dead code) from AccountConnectMultiSele…
EtherWizard33 Dec 25, 2024
45d843b
chore: remove MC FF OFF code (dead code) from AccountPermissions comp…
EtherWizard33 Dec 25, 2024
b4f89f7
chore: remove MC FF OFF code (dead code) from AccountPermissionsConne…
EtherWizard33 Dec 25, 2024
ef81118
chore: remove MC FF OFF code (dead code) from NetworkPermissionsConne…
EtherWizard33 Dec 25, 2024
91d0626
chore: remove MC FF ON check and when applicatable FF OFF Code (dead …
EtherWizard33 Dec 25, 2024
63ce709
refactor(3663): AccountConnect remove checks on feature flag, remove …
EtherWizard33 Dec 26, 2024
a09f72f
refactor(3663): for AccountPermissions component remove checks on fea…
EtherWizard33 Dec 26, 2024
389f36b
fix: previous commit on this AccountConnect file introduced bugs, thi…
EtherWizard33 Dec 27, 2024
c42a109
refactor(3663): for AccountConnectMultiSelector component remove chec…
EtherWizard33 Dec 27, 2024
ea37357
chore(test): remove feature flag-off code, since it is to be dead cod…
EtherWizard33 Jan 13, 2025
cc2571e
style: lint
EtherWizard33 Jan 13, 2025
f96e5cc
chore(test): for NetworkVerification component, update existing unit …
EtherWizard33 Jan 14, 2025
a12fc63
Merge branch 'main' into refactor-3663-chain-permissions-feature-flag…
EtherWizard33 Jan 15, 2025
990f893
test: updating snapshot of account permissions since button label tex…
EtherWizard33 Jan 15, 2025
01c5b3f
chore(test): update snapshot after having removed the feature flag fo…
EtherWizard33 Jan 15, 2025
5341f74
chore(test): update NetworkSwitcher snapshot after having removed the…
EtherWizard33 Jan 15, 2025
8ae0863
chore: remove the feature flag check that checked if the multichain f…
EtherWizard33 Jan 15, 2025
9436363
style: lint
EtherWizard33 Jan 15, 2025
87c1815
chore(test): remove backup snapshots that were used for temporary tro…
EtherWizard33 Jan 15, 2025
70fbc8f
style: tsc lint
EtherWizard33 Jan 16, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const SwitchChainApproval = () => {
onConfirm={onConfirm}
currentPageInformation={pageMeta}
customNetworkInformation={approvalRequest?.requestData}
type={approvalRequest?.requestData?.type}
/>
</ApprovalModal>
);
Expand Down
243 changes: 195 additions & 48 deletions app/components/UI/NetworkModal/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,109 @@ exports[`NetworkDetails renders correctly 1`] = `
Test Network
</Text>
</TouchableOpacity>
<View
style={
{
"marginBottom": 15,
"width": "100%",
}
}
>
<View
style={
{
"backgroundColor": "#bf52081a",
"borderColor": "#bf5208",
"borderLeftWidth": 4,
"borderRadius": 4,
"flexDirection": "row",
"padding": 12,
"paddingLeft": 8,
}
}
testID="banneralert"
variant="Alert"
>
<View
style={
{
"marginRight": 8,
}
}
>
<SvgMock
color="#bf5208"
height={24}
name="Danger"
style={
{
"height": 24,
"width": 24,
}
}
width={24}
/>
</View>
<View
style={
{
"flex": 1,
}
}
>
<Text
accessibilityRole="text"
style={
{
"color": "#141618",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 22,
}
}
>
We can’t verify custom networks. To avoid malicious providers from recording your network activity, only add networks you trust.
</Text>
<Text
accessibilityRole="link"
accessible={true}
onPress={[Function]}
onPressIn={[Function]}
onPressOut={[Function]}
style={
{
"backgroundColor": "transparent",
"color": "#141618",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 22,
}
}
suppressHighlighting={true}
>
<Text
accessibilityRole="text"
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
}
>
Learn more
</Text>
</Text>
</View>
</View>
</View>
<Text
accessibilityRole="text"
style={
Expand All @@ -300,11 +403,8 @@ exports[`NetworkDetails renders correctly 1`] = `
}
}
>
MetaMask doesn’t verify custom networks, so only approve networks you trust.

<Text
accessibilityRole="text"
onPress={[Function]}
style={
{
"color": "#141618",
Expand All @@ -316,7 +416,7 @@ exports[`NetworkDetails renders correctly 1`] = `
}
}
>
Learn more about network security risks and scams.
You're adding this network to MetaMask and giving Undefined dapp origin permission to use it.
</Text>
</Text>
<RCTScrollView
Expand Down Expand Up @@ -344,15 +444,15 @@ exports[`NetworkDetails renders correctly 1`] = `
style={
{
"color": "#141618",
"fontFamily": "EuclidCircularB-Bold",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "700",
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
}
>
Display name
Currency symbol
</Text>
<Text
accessibilityRole="text"
Expand All @@ -368,54 +468,101 @@ exports[`NetworkDetails renders correctly 1`] = `
}
}
>
Test Network
TEST
</Text>
<Text
accessibilityRole="text"
style={
{
"color": "#141618",
"fontFamily": "EuclidCircularB-Bold",
"fontSize": 14,
"fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
}
}
>
Chain ID
</Text>
<Text
accessibilityRole="text"
<View
style={
{
"color": "#141618",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 22,
"marginBottom": 8,
"alignItems": "center",
"flexDirection": "row",
"gap": 8,
}
}
>
1
</Text>
<Text
accessibilityRole="text"
style={
{
"color": "#141618",
"fontFamily": "EuclidCircularB-Bold",
"fontSize": 14,
"fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 22,
<Text
accessibilityRole="text"
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Medium",
"fontSize": 14,
"fontWeight": "500",
"letterSpacing": 0,
"lineHeight": 22,
}
}
}
>
Network URL
</Text>
>
Network RPC URL
</Text>
<TouchableOpacity
onPress={[Function]}
>
<View
style={
{
"alignItems": "center",
"alignSelf": "flex-start",
"backgroundColor": "#0376c91a",
"borderRadius": 4,
"height": 20,
"justifyContent": "center",
"paddingHorizontal": 8,
}
}
testID="tagcolored"
>
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
"gap": 4,
}
}
>
<SvgMock
color="#0376c9"
height={16}
name="Info"
style={
{
"height": 16,
"width": 16,
}
}
width={16}
/>
<Text
accessibilityRole="text"
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 12,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 20,
}
}
>
Review
</Text>
<SvgMock
color="#0376c9"
height={12}
name="ArrowRight"
style={
{
"height": 12,
"width": 12,
}
}
width={12}
/>
</View>
</View>
</TouchableOpacity>
</View>
<Text
accessibilityRole="text"
style={
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import NetworkVerificationInfo from './NetworkVerificationInfo';
import { render } from '@testing-library/react-native';
import { render, fireEvent } from '@testing-library/react-native';
import { BannerAlertSeverity } from '../../../component-library/components/Banners/Banner';
import { strings } from '../../../../locales/i18n';
import { useSelector } from 'react-redux';
Expand Down Expand Up @@ -85,7 +85,7 @@ describe('NetworkVerificationInfo', () => {
).toThrow('Unable to find an element with text');
});

it('should render chainId on decimal', () => {
it('should render chainId as a decimal', () => {
(useSelector as jest.Mock).mockReturnValue(true);
const { getByText } = render(
<NetworkVerificationInfo
Expand All @@ -95,6 +95,12 @@ describe('NetworkVerificationInfo', () => {
/>,
);

// Accordion content is hidden by default, so we need to expand it
const accordionButton = getByText(
strings('spend_limit_edition.view_details'),
);
fireEvent.press(accordionButton);

expect(getByText('10')).toBeTruthy();
});

Expand Down
Loading
Loading