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

fix: remove linea mainnet feature toggle #7122

Closed
Closed
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
32 changes: 0 additions & 32 deletions app/components/Nav/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ import {
selectProviderConfig,
selectProviderType,
} from '../../../selectors/networkController';
import WarningAlert from '../../../components/UI/WarningAlert/WarningAlert';
import { LINEA_MAINNET } from '../../../constants/network';
import jsonRpcRequest from '../../../util/jsonRpcRequest';
import { LINEA_MAINNET_RPC_URL } from '../../../constants/urls';

const Stack = createStackNavigator();

Expand All @@ -91,7 +87,6 @@ const Main = (props) => {
const [forceReload, setForceReload] = useState(false);
const [showRemindLaterModal, setShowRemindLaterModal] = useState(false);
const [skipCheckbox, setSkipCheckbox] = useState(false);
const [showLineaMainnetAlert, setShowLineaMainnetAlert] = useState(false);
const { colors } = useTheme();
const styles = createStyles(colors);

Expand Down Expand Up @@ -306,20 +301,6 @@ const Main = (props) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const checkLineaMainnetAvailability = useCallback(async () => {
if (props.providerType === LINEA_MAINNET) {
try {
await jsonRpcRequest(LINEA_MAINNET_RPC_URL, 'eth_blockNumber', []);
} catch (e) {
setShowLineaMainnetAlert(true);
}
}
}, [props.providerType]);

useEffect(() => {
checkLineaMainnetAvailability();
}, [checkLineaMainnetAvailability]);

const termsOfUse = useCallback(async () => {
if (props.navigation) {
await navigateTermsOfUse(props.navigation.navigate);
Expand All @@ -330,17 +311,6 @@ const Main = (props) => {
termsOfUse();
}, [termsOfUse]);

const renderLineaMainnetAlert = (networkType) => {
if (networkType === LINEA_MAINNET && showLineaMainnetAlert) {
return (
<WarningAlert
text={strings('networks.linea_mainnet_not_released_alert')}
dismissAlert={() => setShowLineaMainnetAlert(false)}
/>
);
}
};

return (
<React.Fragment>
<View style={styles.flex}>
Expand All @@ -358,8 +328,6 @@ const Main = (props) => {
onDismiss={toggleRemindLater}
navigation={props.navigation}
/>
{renderLineaMainnetAlert(props.providerType)}

<SkipAccountSecurityModal
modalVisible={showRemindLaterModal}
onCancel={skipAccountModalSecureNow}
Expand Down
14 changes: 2 additions & 12 deletions app/components/Views/NetworkSelector/NetworkSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Third party dependencies.
import React, { useEffect, useRef, useState } from 'react';
import React, { useRef } from 'react';
import { Platform, Switch, View } from 'react-native';
import { ScrollView } from 'react-native-gesture-handler';
import images from 'images/image-icons';
Expand Down Expand Up @@ -27,7 +27,6 @@ import Networks, {
getAllNetworks,
getNetworkImageSource,
isTestNet,
shouldShowLineaMainnetNetwork,
} from '../../../util/networks';
import { LINEA_MAINNET, MAINNET } from '../../../constants/network';
import Button from '../../../component-library/components/Buttons/Button/Button';
Expand Down Expand Up @@ -62,19 +61,10 @@ const NetworkSelector = () => {
const { colors } = useAppTheme();
const sheetRef = useRef<SheetBottomRef>(null);
const showTestNetworks = useSelector(selectShowTestNetworks);
const [lineaMainnetReleased, setLineaMainnetReleased] = useState(false);

const providerConfig: ProviderConfig = useSelector(selectProviderConfig);
const networkConfigurations = useSelector(selectNetworkConfigurations);

useEffect(() => {
const shouldShowLineaMainnet = shouldShowLineaMainnetNetwork();

if (shouldShowLineaMainnet) {
setLineaMainnetReleased(shouldShowLineaMainnet);
}
}, []);

const onNetworkChange = (type: string) => {
const { NetworkController, CurrencyRateController, TransactionController } =
Engine.context;
Expand Down Expand Up @@ -249,7 +239,7 @@ const NetworkSelector = () => {
<SheetHeader title={strings('networks.select_network')} />
<ScrollView {...generateTestId(Platform, NETWORK_SCROLL_ID)}>
{renderMainnet()}
{lineaMainnetReleased && renderLineaMainnet()}
{renderLineaMainnet()}
{renderRpcNetworks()}
{renderTestNetworksSwitch()}
{showTestNetworks && renderOtherNetworks()}
Expand Down
7 changes: 1 addition & 6 deletions app/components/Views/Settings/NetworksSettings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import Networks, {
getNetworkImageSource,
isDefaultMainnet,
isLineaMainnet,
shouldShowLineaMainnetNetwork,
} from '../../../../util/networks';
import StyledButton from '../../../UI/StyledButton';
import Engine from '../../../../core/Engine';
Expand Down Expand Up @@ -145,7 +144,6 @@ class NetworksSettings extends PureComponent {
state = {
searchString: '',
filteredNetworks: [],
lineaMainnetReleased: false,
};

updateNavBar = () => {
Expand All @@ -162,9 +160,6 @@ class NetworksSettings extends PureComponent {
};

componentDidMount = () => {
const shouldShowLineaMainnet = shouldShowLineaMainnetNetwork();

this.setState({ lineaMainnetReleased: shouldShowLineaMainnet });
this.updateNavBar();
};

Expand Down Expand Up @@ -498,7 +493,7 @@ class NetworksSettings extends PureComponent {
{strings('app_settings.mainnet')}
</Text>
{this.renderMainnet()}
{this.state.lineaMainnetReleased && this.renderLineaMainnet()}
{this.renderLineaMainnet()}
{this.renderRpcNetworksView()}
<Text style={styles.sectionLabel}>
{strings('app_settings.test_network_name')}
Expand Down
2 changes: 1 addition & 1 deletion app/constants/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const CHAINLIST_URL = 'https://chainlist.wtf';
export const MM_ETHERSCAN_URL = 'https://etherscamdb.info/domain/meta-mask.com';
export const LINEA_GOERLI_BLOCK_EXPLORER = 'https://goerli.lineascan.build';
export const LINEA_MAINNET_BLOCK_EXPLORER = 'https://lineascan.build';
export const LINEA_MAINNET_RPC_URL = `https://linea-mainnet.infura.io/v3/${process.env.MM_INFURA_PROJECT_ID}`;

// Phishing
export const MM_PHISH_DETECT_URL =
'https://github.com/metamask/eth-phishing-detect';
Expand Down
3 changes: 0 additions & 3 deletions app/util/networks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,3 @@ export const getBlockExplorerTxUrl = (
*/
export const getIsNetworkOnboarded = (chainId, networkOnboardedState) =>
networkOnboardedState[chainId];

export const shouldShowLineaMainnetNetwork = () =>
new Date().getTime() > Date.UTC(2023, 6, 11, 18);
3 changes: 1 addition & 2 deletions locales/languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "Sie können aber auch",
"add_network": "weitere Netzwerke manuell hinzufügen.",
"select_network": "Netzwerk wählen",
"show_test_networks": "Testnetzwerke anzeigen",
"linea_mainnet_not_released_alert": "Vielen Dank für Ihr Interesse an Linea Mainnet. Schon bald erhältlich!"
"show_test_networks": "Testnetzwerke anzeigen"
},
"select": {
"cancel": "Abbrechen",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "Ή μπορείτε",
"add_network": "να προσθέσετε περισσότερα δίκτυα χειροκίνητα.",
"select_network": "Επιλέξτε ένα δίκτυο",
"show_test_networks": "Εμφάνιση δοκιμαστικών δικτύων",
"linea_mainnet_not_released_alert": "Ευχαριστούμε για το ενδιαφέρον σας για το Linea Mainnet, θα είναι διαθέσιμο σύντομα!"
"show_test_networks": "Εμφάνιση δοκιμαστικών δικτύων"
},
"select": {
"cancel": "Άκυρο",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1362,8 +1362,7 @@
"you_can": "Or you can",
"add_network": "add more networks manually.",
"select_network": "Select a network",
"show_test_networks": "Show test networks",
"linea_mainnet_not_released_alert": "Thanks for your interest in Linea Mainnet, it will be available soon!"
"show_test_networks": "Show test networks"
},
"select": {
"cancel": "Cancel",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "O puede",
"add_network": "agregar más redes manualmente.",
"select_network": "Seleccionar una red",
"show_test_networks": "Mostrar redes de prueba",
"linea_mainnet_not_released_alert": "Gracias por su interés en red principal de Linea, ¡estará disponible muy pronto!"
"show_test_networks": "Mostrar redes de prueba"
},
"select": {
"cancel": "Cancelar",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "Ou vous pouvez",
"add_network": "ajouter manuellement d’autres réseaux.",
"select_network": "Sélectionner un réseau",
"show_test_networks": "Afficher les réseaux de test",
"linea_mainnet_not_released_alert": "Nous vous remercions de l’intérêt que vous avez manifesté pour le réseau principal de Linea, il sera bientôt disponible !"
"show_test_networks": "Afficher les réseaux de test"
},
"select": {
"cancel": "Annuler",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "या आप",
"add_network": "मैन्युअल रूप से अधिक नेटवर्क जोड़ें।",
"select_network": "एक नेटवर्क चुनें",
"show_test_networks": "परीक्षण नेटवर्क दिखाएं",
"linea_mainnet_not_released_alert": "Linea Mainnet में आपकी रुचि के लिए धन्यवाद, यह जल्द ही उपलब्ध होगा!"
"show_test_networks": "परीक्षण नेटवर्क दिखाएं"
},
"select": {
"cancel": "रद्द करें",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "Atau Anda dapat",
"add_network": "menambahkan lebih banyak jaringan secara manual.",
"select_network": "Pilih jaringan",
"show_test_networks": "Tampilkan jaringan pengujian",
"linea_mainnet_not_released_alert": "Terima kasih atas minat Anda pada Linea Mainnet, yang akan segera tersedia!"
"show_test_networks": "Tampilkan jaringan pengujian"
},
"select": {
"cancel": "Batal",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "または",
"add_network": "他のネットワークを手動で追加できます。",
"select_network": "ネットワークを選択",
"show_test_networks": "テストネットワークを表示",
"linea_mainnet_not_released_alert": "Linea メインネットにご関心をお持ちいただきありがとうございます。間もなく利用可能になります!"
"show_test_networks": "テストネットワークを表示"
},
"select": {
"cancel": "キャンセル",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "또는 다음을 확인하세요:",
"add_network": "네트워크를 직접 추가할 수도 있습니다.",
"select_network": "네트워크 선택",
"show_test_networks": "테스트 네트워크 보기",
"linea_mainnet_not_released_alert": "Linea Mainnet에 관심을 보여 주셔서 감사합니다. 곧 출시할 예정입니다!"
"show_test_networks": "테스트 네트워크 보기"
},
"select": {
"cancel": "취소",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "Ou você pode",
"add_network": "adicionar mais redes manualmente.",
"select_network": "Selecione uma rede",
"show_test_networks": "Exibir redes de teste",
"linea_mainnet_not_released_alert": "Agradecemos seu interesse na mainnet do Linea. Ela estará disponível em breve!"
"show_test_networks": "Exibir redes de teste"
},
"select": {
"cancel": "Cancelar",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "Или вы можете",
"add_network": "добавить другие сети вручную.",
"select_network": "Выбрать сеть",
"show_test_networks": "Показать тестовые сети",
"linea_mainnet_not_released_alert": "Спасибо за Ваш интерес к сети Linea Mainnet. Она скоро станет доступна!"
"show_test_networks": "Показать тестовые сети"
},
"select": {
"cancel": "Отмена",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/tl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "O maaari kang",
"add_network": "magdagdag pa ng mga network nang manu-mano.",
"select_network": "Pumili ng network",
"show_test_networks": "Ipakita ang mga test network",
"linea_mainnet_not_released_alert": "Salamat sa iyong interes sa Linea Mainnet, malapit na itong maging available!"
"show_test_networks": "Ipakita ang mga test network"
},
"select": {
"cancel": "Kanselahin",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "Veya",
"add_network": "manuel olarak daha fazla ekleyebilirsiniz.",
"select_network": "Bir ağ seçin",
"show_test_networks": "Test ağlarını göster",
"linea_mainnet_not_released_alert": "Linea Ana Ağına gösterdiğiniz ilgi için teşekkürler, çok yakında kullanıma sunulacak!"
"show_test_networks": "Test ağlarını göster"
},
"select": {
"cancel": "İptal",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "Hoặc bạn có thể",
"add_network": "thêm thủ công các mạng khác.",
"select_network": "Chọn mạng",
"show_test_networks": "Hiển thị các mạng thử nghiệm",
"linea_mainnet_not_released_alert": "Cảm ơn bạn đã quan tâm đến Mạng chính thức của Linea, nó sẽ sớm ra mắt!"
"show_test_networks": "Hiển thị các mạng thử nghiệm"
},
"select": {
"cancel": "Hủy",
Expand Down
3 changes: 1 addition & 2 deletions locales/languages/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,7 @@
"you_can": "或者您可以",
"add_network": "手动添加更多网络。",
"select_network": "选择网络",
"show_test_networks": "显示测试网络",
"linea_mainnet_not_released_alert": "感谢您对 Linea 主网感兴趣,它即将发布!"
"show_test_networks": "显示测试网络"
},
"select": {
"cancel": "取消",
Expand Down