From 1fca9255c148f65d9dd468ab7228d1f8c3bdbf2a Mon Sep 17 00:00:00 2001 From: Victorien Gauch <85494462+VGau@users.noreply.github.com> Date: Thu, 15 Jun 2023 13:38:07 +0200 Subject: [PATCH] fix: refactor linea goerli testnet implementation (#19321) * fix: refactor linea goerli testnet implementation * fix: rename linea goerli network * feat: add linea testnet logo * update linea goerli block explorer url * update @metamask/eth-json-rpc-infura package to version 8.1.0 * fix: refactor ticker map object in shared/constants/networks.ts files --- app/_locales/am/messages.json | 4 +- app/_locales/ar/messages.json | 4 +- app/_locales/bg/messages.json | 4 +- app/_locales/ca/messages.json | 4 +- app/_locales/da/messages.json | 4 +- app/_locales/de/messages.json | 4 +- app/_locales/el/messages.json | 4 +- app/_locales/en/messages.json | 4 +- app/_locales/es/messages.json | 4 +- app/_locales/es_419/messages.json | 4 +- app/_locales/et/messages.json | 4 +- app/_locales/fa/messages.json | 4 +- app/_locales/fi/messages.json | 4 +- app/_locales/fil/messages.json | 2 +- app/_locales/fr/messages.json | 4 +- app/_locales/he/messages.json | 4 +- app/_locales/hi/messages.json | 4 +- app/_locales/hr/messages.json | 4 +- app/_locales/hu/messages.json | 4 +- app/_locales/id/messages.json | 4 +- app/_locales/it/messages.json | 4 +- app/_locales/ja/messages.json | 4 +- app/_locales/kn/messages.json | 4 +- app/_locales/ko/messages.json | 4 +- app/_locales/lt/messages.json | 4 +- app/_locales/lv/messages.json | 4 +- app/_locales/ms/messages.json | 4 +- app/_locales/no/messages.json | 2 +- app/_locales/ph/messages.json | 4 +- app/_locales/pl/messages.json | 4 +- app/_locales/pt/messages.json | 4 +- app/_locales/pt_BR/messages.json | 4 +- app/_locales/ro/messages.json | 4 +- app/_locales/ru/messages.json | 4 +- app/_locales/sk/messages.json | 4 +- app/_locales/sl/messages.json | 4 +- app/_locales/sr/messages.json | 4 +- app/_locales/sv/messages.json | 4 +- app/_locales/sw/messages.json | 4 +- app/_locales/tl/messages.json | 4 +- app/_locales/tr/messages.json | 4 +- app/_locales/uk/messages.json | 4 +- app/_locales/vi/messages.json | 4 +- app/_locales/zh_CN/messages.json | 4 +- app/_locales/zh_TW/messages.json | 4 +- app/images/linea-logo-testnet.png | Bin 0 -> 1411 bytes app/scripts/controllers/transactions/index.js | 6 +- development/states/navigate-txs.json | 2 +- lavamoat/build-system/policy.json | 71 ++++++++++++++++-- package.json | 2 +- shared/constants/network.ts | 64 ++++++++-------- test/e2e/fixture-builder.js | 1 + .../loading-network-screen.component.js | 4 +- .../app/network-display/network-display.js | 3 +- .../component-library/text/text.stories.tsx | 4 +- .../network-list-item/network-list-item.js | 6 +- .../network-list-menu/network-list-menu.js | 28 +------ ui/components/ui/typography/typography.js | 4 +- ui/css/design-system/colors.scss | 4 +- ui/css/utilities/colors.scss | 4 +- ui/helpers/constants/design-system.ts | 16 ++-- ui/helpers/constants/settings.js | 6 +- ui/helpers/utils/i18n-helper.tsx | 8 ++ ui/helpers/utils/util.js | 2 +- ui/pages/routes/routes.component.js | 4 +- .../networks-form/networks-form.js | 4 +- .../networks-list-item/networks-list-item.js | 6 +- .../networks-tab/networks-tab.constants.js | 16 ++-- .../settings/networks-tab/networks-tab.js | 22 ++---- ui/selectors/selectors.js | 23 +++--- yarn.lock | 10 +-- 71 files changed, 266 insertions(+), 230 deletions(-) create mode 100644 app/images/linea-logo-testnet.png diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index 738b89035..17317ce1b 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -151,7 +151,7 @@ "connectingToGoerli": { "message": "ከ Goerli የሙከራ አውታረ መረብ ጋር መገናኘት" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "ከ Linea Goerli የሙከራ አውታረ መረብ ጋር መገናኘት" }, "connectingToMainnet": { @@ -394,7 +394,7 @@ "likeToImportTokens": { "message": "እነዚህን ተለዋጭ ስሞች ለማከል ይፈልጋሉ?" }, - "lineatestnet": { + "lineaGoerli": { "message": "የ Linea Goerli የሙከራ አውታረ መረብ" }, "links": { diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index 7c8d5e8cc..f267c3675 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -161,7 +161,7 @@ "connectingToGoerli": { "message": "الاتصال بشبكة اختبار Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "الاتصال بشبكة اختبار Linea Goerli" }, "connectingToMainnet": { @@ -406,7 +406,7 @@ "likeToImportTokens": { "message": "هل ترغب في إضافة هذه الرموز؟" }, - "lineatestnet": { + "lineaGoerli": { "message": "شبكة اختبار Linea Goerli" }, "links": { diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index e7f9cf036..d361b9a1e 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Свързване с тестова мрежа на Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Свързване с тестова мрежа на Linea Goerli" }, "connectingToMainnet": { @@ -402,7 +402,7 @@ "likeToImportTokens": { "message": "Искате ли да добавите тези жетони?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Тестова мрежа на Linea Goerli" }, "links": { diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index 39da6ced2..b13885495 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -154,7 +154,7 @@ "connectingToGoerli": { "message": "Connectant a Xarxa de Prova Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Connectant a Xarxa de Prova Linea Goerli" }, "connectingToMainnet": { @@ -393,7 +393,7 @@ "likeToImportTokens": { "message": "T'agradaria afegir aquestes fitxes?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Xarxa de test Linea Goerli" }, "links": { diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index 682d0f92b..36c0b7528 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Opretter forbindelse til Goerli Testnetværk" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Opretter forbindelse til Linea Goerli Testnetværk" }, "connectingToMainnet": { @@ -399,7 +399,7 @@ "likeToImportTokens": { "message": "Ønsker du at tilføje disse tokens?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea-testnetværk" }, "loadMore": { diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 89c51cf8b..8b1b4aad2 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Verbindungsaufbau zum Goerli-Testnetzwerk" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Verbindungsaufbau zum Linea-Testnetzwerk" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "Möchtest du diese Token hinzufügen?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea-Testnetzwerk" }, "link": { diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 7c10d5387..eff68ba30 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Σύνδεση στο Δίκτυο Δοκιμής Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Σύνδεση στο δίκτυο δοκιμών Linea Goerli" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "Θέλετε να προσθέσετε αυτά τα token;" }, - "lineatestnet": { + "lineaGoerli": { "message": "Δίκτυο δοκιμών Linea Goerli" }, "link": { diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index dec7d37e1..4ce75852b 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -796,7 +796,7 @@ "connectingToGoerli": { "message": "Connecting to Goerli test network" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Connecting to Linea Goerli test network" }, "connectingToMainnet": { @@ -2126,7 +2126,7 @@ "likeToImportTokens": { "message": "Would you like to import these tokens?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli test network" }, "link": { diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index 1aa55ff86..17a2744e1 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Estableciendo conexión a la red de prueba Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Conectando a la red de prueba Linea Goerli" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "¿Le gustaría agregar estos tokens?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Red de prueba Linea Goerli" }, "link": { diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index ce197f422..782dbd2ea 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -442,7 +442,7 @@ "connectingToGoerli": { "message": "Estableciendo conexión a la red de prueba Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Estableciendo conexión a la red de prueba Linea Goerli" }, "connectingToMainnet": { @@ -1245,7 +1245,7 @@ "likeToImportTokens": { "message": "¿Quiere agregar estos tokens?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Red de prueba Linea Goerli" }, "link": { diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index 72f405034..88990874e 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Ühendamine Goerli testvõrguga" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Ühendamine Linea Goerli testvõrguga" }, "connectingToMainnet": { @@ -402,7 +402,7 @@ "likeToImportTokens": { "message": "Kas soovite need load lisada?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli testvõrk" }, "links": { diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index 117c10f99..895952bde 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "در حال اتصال به شبکه آزمایشی Goerli " }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "در حال اتصال به شبکه آزمایشی Linea Goerli" }, "connectingToMainnet": { @@ -406,7 +406,7 @@ "likeToImportTokens": { "message": "آیا میخواهید این رمزیاب ها را اضافه نمایید؟" }, - "lineatestnet": { + "lineaGoerli": { "message": "شبکه آزمایشی Linea Goerli" }, "links": { diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index 62df9b8a3..5060b9015 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Yhdistetään Goerlin testiverkostoon" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Yhdistetään Linea Goerli testiverkostoon" }, "connectingToMainnet": { @@ -406,7 +406,7 @@ "likeToImportTokens": { "message": "Haluaisitko lisätä nämä poletit?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea-testiverkko" }, "links": { diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index 3bae47498..da943eaea 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -136,7 +136,7 @@ "connectingToGoerli": { "message": "Kumokonekta sa Goerli Test Network" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Kumokonekta sa Linea Goerli Test Network" }, "connectingToMainnet": { diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index f6c362fb5..5101c57f4 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Connexion au testnet Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Connexion au réseau de test Linea Goerli" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "Souhaitez-vous ajouter ces jetons ?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Réseau de test Linea Goerli" }, "link": { diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index 38e8acd52..677d3cea9 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "מתחבר ל-Goerli Test Network" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "מתחבר ל-Linea Goerli Test Network" }, "connectingToMainnet": { @@ -406,7 +406,7 @@ "likeToImportTokens": { "message": "האם ברצונך להוסיף טוקנים אלה?" }, - "lineatestnet": { + "lineaGoerli": { "message": "רשת בדיקה Linea Goerli" }, "links": { diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 4c0ab8b46..4fca23854 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Goerli टेस्ट नेटवर्क से कनेक्ट हो रहा है" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Linea Goerli टेस्ट नेटवर्क से कनेक्ट हो रहा है" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "क्या आप इन टोकन को इंपोर्ट करना चाहते हैं?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli टेस्ट नेटवर्क" }, "link": { diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index ce44c7960..ab8273274 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Povezivanje na testnu mrežu Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Povezivanje na testnu mrežu Linea Goerli" }, "connectingToMainnet": { @@ -402,7 +402,7 @@ "likeToImportTokens": { "message": "Želite li dodati ove tokene?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Testna mreža Linea Goerli" }, "links": { diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index a391daceb..dc10e6cb6 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Csatlakozás a Goerli teszthálózathoz" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Csatlakozás a Linea Goerli teszthálózathoz" }, "connectingToMainnet": { @@ -402,7 +402,7 @@ "likeToImportTokens": { "message": "Hozzá szeretné adni ezeket az érméket?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli teszthálózat" }, "links": { diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 8ffa88b9d..d4babd8b2 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Menghubungkan ke jaringan uji Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Menghubungkan ke jaringan uji Linea Goerli" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "Apakah Anda ingin menambahkan token ini?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Jaringan uji Linea Goerli" }, "link": { diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index 6116dad19..bf069ec0a 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -532,7 +532,7 @@ "connectingToGoerli": { "message": "Connessione alla Rete di Test Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Connessione alla Rete di test Linea Goerli" }, "connectingToMainnet": { @@ -1106,7 +1106,7 @@ "likeToImportTokens": { "message": "Vorresti aggiungere questi token?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Rete di test Linea Goerli" }, "links": { diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 2d5958dc7..0830623e7 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Goerliテストネットワークに接続中" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Linea Goerli テストネットワークに接続中" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "これらのトークンを追加しますか?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli テストネットワーク" }, "link": { diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index 41bb6f767..205103048 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Goerli ಪರೀಕ್ಷಾ ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಿಸಲಾಗುತ್ತಿದೆ" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Linea Goerli ಪರೀಕ್ಷಾ ನೆಟ್‌ವರ್ಕ್‌ಗೆ ಸಂಪರ್ಕಿಸಲಾಗುತ್ತಿದೆ" }, "connectingToMainnet": { @@ -406,7 +406,7 @@ "likeToImportTokens": { "message": "ನೀವು ಈ ಟೋಕನ್‌ಗಳನ್ನು ಸೇರಿಸಲು ಬಯಸುತ್ತೀರಾ?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli ಪರೀಕ್ಷೆ ನೆಟ್‌ವರ್ಕ್" }, "links": { diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 6c7954746..3cf3cb19c 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Goerli 테스트 네트워크에 연결 중" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Linea Goerli 테스트 네트워크에 연결 중" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "이 토큰을 추가할까요?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli 테스트 네트워크" }, "link": { diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index efab1614e..927c5f060 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Jungiamasi prie „Goerli“ bandomojo tinklo" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Jungiamasi prie „Linea“ bandomojo tinklo" }, "connectingToMainnet": { @@ -406,7 +406,7 @@ "likeToImportTokens": { "message": "Ar norėtumėte pridėti šiuos žetonus?" }, - "lineatestnet": { + "lineaGoerli": { "message": "„Linea“ bandomasis tinklas" }, "links": { diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index c77b7c5f2..bb8382426 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Pieslēdzas Goerli testa tīklam" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Pieslēdzas Linea Goerli testa tīklam" }, "connectingToMainnet": { @@ -402,7 +402,7 @@ "likeToImportTokens": { "message": "Vai vēlaties pievienot šos marķierus?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli testa tīkls" }, "links": { diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index d2366d0dd..546834ed4 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Menyambung kepada Rangkaian Ujian Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Menyambung kepada Rangkaian Ujian Linea Goerli" }, "connectingToMainnet": { @@ -395,7 +395,7 @@ "likeToImportTokens": { "message": "Adakah anda ingin menambah token ini?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Rangkaian Ujian Linea Goerli" }, "links": { diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 37f025131..d1ec686b6 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -154,7 +154,7 @@ "connectingToGoerli": { "message": "Oppretter forbindelse med Goerli Test Network" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Oppretter forbindelse med Linea Goerli Test Network" }, "connectingToMainnet": { diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index 6e6b58dd3..a9787f21c 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -305,7 +305,7 @@ "connectingToGoerli": { "message": "Kumokonekta sa Goerli Test Network" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Kumokonekta sa Linea Goerli Test Network" }, "connectingToMainnet": { @@ -795,7 +795,7 @@ "likeToImportTokens": { "message": "Gusto mo bang idagdag ang mga token na ito?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli Test Network" }, "links": { diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index 35a27a61e..eed32951c 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Łączenie z siecią testową Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Łączenie z siecią testową Linea Goerli" }, "connectingToMainnet": { @@ -406,7 +406,7 @@ "likeToImportTokens": { "message": "Czy chcesz dodać te tokeny?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Sieć testowa Linea Goerli" }, "links": { diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 0cf52874c..3daf84053 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Conectando à rede de testes Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Conectando à rede de teste Linea Goerli" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "Gostaria de adicionar estes tokens?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Rede de teste Linea Goerli" }, "link": { diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index e1f85da0b..33f3e50e8 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -442,7 +442,7 @@ "connectingToGoerli": { "message": "Conectando à rede de testes Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Conectando à rede de testes Linea Goerli" }, "connectingToMainnet": { @@ -1245,7 +1245,7 @@ "likeToImportTokens": { "message": "Você gostaria de importar esses tokens?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Rede de testes Linea Goerli" }, "link": { diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index 99ef71954..9e64935a9 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Se conectează la rețeaua de test Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Se conectează la rețeaua de test Linea Goerli" }, "connectingToMainnet": { @@ -396,7 +396,7 @@ "likeToImportTokens": { "message": "Adăugați aceste indicative?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Rețea de test Linea Goerli" }, "links": { diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 090fde4b0..5a77736dd 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Подключение к тестовой сети Goerli..." }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Подключение к тестовой сети Linea..." }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "Вы хотели бы импортировать эти токены?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Тестовая сеть Linea Goerli" }, "link": { diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index e65d2a322..a9e8111ba 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -151,7 +151,7 @@ "connectingToGoerli": { "message": "Pripája sa k testovacej sieti Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Pripája sa k testovacej sieti Linea Goerli" }, "connectingToMainnet": { @@ -393,7 +393,7 @@ "likeToImportTokens": { "message": "Chcete přidat tyto tokeny?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Testovacia sieť Linea Goerli" }, "links": { diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index 3bee0543a..3f5d61814 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Povezovanje na testno omrežje Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Povezovanje na testno omrežje Linea Goerli" }, "connectingToMainnet": { @@ -400,7 +400,7 @@ "likeToImportTokens": { "message": "Želite dodati te žetone?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Testno omrežje Linea Goerli" }, "links": { diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index 6147900b9..858eb96f9 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -154,7 +154,7 @@ "connectingToGoerli": { "message": "Povezuje se sa test mrežom Goerli " }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Povezuje se sa test mrežom Linea Goerli" }, "connectingToMainnet": { @@ -403,7 +403,7 @@ "likeToImportTokens": { "message": "Želite li da dodate ove tokene?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Test mreža Linea Goerli" }, "links": { diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index 051598930..b9c1f3ea7 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -151,7 +151,7 @@ "connectingToGoerli": { "message": "Ansluter till Goerli Test Network" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Ansluter till Linea Goerli Test Network" }, "connectingToMainnet": { @@ -396,7 +396,7 @@ "likeToImportTokens": { "message": "Vill du lägga till dessa tokens?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli testnätverk" }, "links": { diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index 188704a48..0dbae2de3 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -151,7 +151,7 @@ "connectingToGoerli": { "message": "Inaunganisha kwenye Mtandao wa Majaribio wa Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Inaunganisha kwenye Mtandao wa Majaribio wa Linea Goerli" }, "connectingToMainnet": { @@ -393,7 +393,7 @@ "likeToImportTokens": { "message": "Je, ungependa kuongeza vianzio hivi?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Mtandao wa Majaribio wa Linea Goerli" }, "links": { diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index 6396a3c8c..a7fdb7005 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Kumokonekta sa Goerli Test Network" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Kumokonekta sa Linea Goerli test network" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "Gusto mo bang idagdag ang mga token na ito?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli test network" }, "link": { diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 8e1e428f8..1c30a8383 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Goerli Test Ağına Bağlanıyor" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Linea Goerli test ağına bağlanılıyor" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "Bu tokenleri içe aktarmak ister misiniz?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli test ağı" }, "link": { diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index 66c2f98b0..08288b336 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -157,7 +157,7 @@ "connectingToGoerli": { "message": "Підключення до тестової мережі Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Підключення до тестової мережі Linea Goerli" }, "connectingToMainnet": { @@ -406,7 +406,7 @@ "likeToImportTokens": { "message": "Ви б хотіли додати ці токени?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Тестова мережа Linea Goerli" }, "links": { diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 425384282..c5af50467 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "Đang kết nối với mạng thử nghiệm Goerli" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "Đang kết nối với mạng thử nghiệm Linea Goerli" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "Bạn có muốn nhập những token này không?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Mạng thử nghiệm Linea Goerli" }, "link": { diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 133ccd0ea..94d2dcf83 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -689,7 +689,7 @@ "connectingToGoerli": { "message": "正在连接 Goerli 测试网络" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "正在连接Linea测试网络" }, "connectingToMainnet": { @@ -1840,7 +1840,7 @@ "likeToImportTokens": { "message": "您想导入这些代币吗?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea测试网络" }, "link": { diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index eb24a0655..5af0125f6 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -304,7 +304,7 @@ "connectingToGoerli": { "message": "連線到 Goerli 測試網路" }, - "connectingToLineaTestnet": { + "connectingToLineaGoerli": { "message": "連線到 Linea Goerli 測試網路" }, "connectingToMainnet": { @@ -803,7 +803,7 @@ "likeToImportTokens": { "message": "確定要加入代幣?" }, - "lineatestnet": { + "lineaGoerli": { "message": "Linea Goerli 測試網路" }, "links": { diff --git a/app/images/linea-logo-testnet.png b/app/images/linea-logo-testnet.png new file mode 100644 index 0000000000000000000000000000000000000000..d9f78720bb1d17dde550b8eff3fa590133a8f815 GIT binary patch literal 1411 zcmeAS@N?(olHy`uVBq!ia0vp^CqS5k4M?tyST_$yaTa()7Bet#3xhBt!>l*8o|0J?9FtAE^x;TbZFuuKOpD`t!;rPenNz(#mA60GA zYqGj>RLtr{f;fA3Np6dt?3N3DxtR+mdvoi)y|%DWcgDKhuGP9PE;vSCXyOX$NSLOx z@aWNlzxEtWNc!|SUhn&zz4Q5HTqYDu_ynQ}Z71UOij z8Xc%d-R8Dw-d!$s>eAEh)Su7dpWd@St=)ezw))hOzLiE>-(NM_`u||^{ewn)EQf@z zGUUzuy-(+l(RYOjw_pEXetLS?-_2~BKW{z!^uS90-SgeAn#CVH<|fxxn4P!n_s`0= zmWIZg7IL(d>i(u-+#JUY#2bc zw8T~e)g3(WXvH+SHKBTQY;Ng(b8mEr2z2jj{V9KX!Bva8|3B{f&fUk`=uoxBZ++Cpiib5I zcFxaZTQ7B0-Q0dOa~hDBc~-rkedV!>kM5Q>ehG=K-?FSvX|14#|5l5+JHO{wpU+%l z?sIi+{_M<0Pl2IWZ&P+^>x!cp$E_xGFE{(nS9teF@ryI%t^W*;zFH~vJ$cKIIV_ig zCtrS>Tc7)J0Xxvd+UIAvf z${yO6*HpD`aAkVAQR?_S;rCM#t1C{#bOU`?oqkXLmqyU}(^*p;s@CnRes5d3i|6#0 z*~e$kjSFR3DDC=c;pOPHeKG9zzZPxrQ7F;Bk~pU3w|TkNoUkp{!rMLjTTPd++^?4u=~7bJ?znm(~{AzrU68{B`^8z{Pqe+@EUm%RSY; z(eWxHDE?0A_IO+G@{ij;-_6vJmfaAbydv<8P05eeLs_j36L!`!O?tU>y=%eyqy<;l`i#+|A}Yv&$vJlVwj>{C{{uYFPxe f%La11|3Q9*wt)9KbEU(;GLym6)z4*}Q$iB}h5Ryo literal 0 HcmV?d00001 diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js index fd1f493fd..93d3ab382 100644 --- a/app/scripts/controllers/transactions/index.js +++ b/app/scripts/controllers/transactions/index.js @@ -277,7 +277,11 @@ export default class TransactionController extends EventEmitter { // type will be one of our default network names or 'rpc'. the default // network names are sufficient configuration, simply pass the name as the // chain argument in the constructor. - if (type !== NETWORK_TYPES.RPC && type !== NETWORK_TYPES.SEPOLIA) { + if ( + type !== NETWORK_TYPES.RPC && + type !== NETWORK_TYPES.SEPOLIA && + type !== NETWORK_TYPES.LINEA_GOERLI + ) { return new Common({ chain: type, hardfork, diff --git a/development/states/navigate-txs.json b/development/states/navigate-txs.json index 12fc75607..32daeee71 100644 --- a/development/states/navigate-txs.json +++ b/development/states/navigate-txs.json @@ -305,7 +305,7 @@ "mainnet": "ok", "goerli": "ok", "sepolia": "ok", - "lineatestnet": "ok" + "lineaGoerli": "ok" } }, "send": { diff --git a/lavamoat/build-system/policy.json b/lavamoat/build-system/policy.json index e41d0153c..166b663a6 100644 --- a/lavamoat/build-system/policy.json +++ b/lavamoat/build-system/policy.json @@ -980,6 +980,7 @@ "packages": { "@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>are-we-there-yet": true, "@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge": true, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>console-control-strings": true, "@storybook/react>@storybook/node-logger>npmlog>console-control-strings": true, "nyc>yargs>set-blocking": true } @@ -1008,6 +1009,9 @@ "@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge>aproba": true, "@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge>string-width": true, "@lavamoat/allow-scripts>@npmcli/run-script>node-gyp>npmlog>gauge>strip-ansi": true, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>console-control-strings": true, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>has-unicode": true, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>wide-align": true, "@storybook/react>@storybook/node-logger>npmlog>console-control-strings": true, "@storybook/react>@storybook/node-logger>npmlog>gauge>has-unicode": true, "@storybook/react>@storybook/node-logger>npmlog>gauge>wide-align": true, @@ -1133,11 +1137,33 @@ "@metamask/jazzicon>color>color-convert>color-name": true } }, + "@sentry/cli>mkdirp": { + "builtin": { + "fs": true, + "path.dirname": true, + "path.resolve": true + } + }, "@storybook/addon-knobs>qs": { "packages": { "string.prototype.matchall>side-channel": true } }, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>has-unicode": { + "builtin": { + "os.type": true + }, + "globals": { + "process.env.LANG": true, + "process.env.LC_ALL": true, + "process.env.LC_CTYPE": true + } + }, + "@storybook/addon-mdx-gfm>@storybook/node-logger>npmlog>gauge>wide-align": { + "packages": { + "yargs>string-width": true + } + }, "@storybook/core>@storybook/core-server>x-default-browser>default-browser-id>untildify>os-homedir": { "builtin": { "os.homedir": true @@ -4886,9 +4912,20 @@ }, "packages": { "@storybook/core>@storybook/core-server>x-default-browser>default-browser-id>untildify>os-homedir": true, + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-homedir": true, "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-tmpdir": true } }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-homedir": { + "builtin": { + "os.homedir": true + }, + "globals": { + "process.env": true, + "process.getuid": true, + "process.platform": true + } + }, "gulp-watch>chokidar>fsevents>node-pre-gyp>nopt>osenv>os-tmpdir": { "globals": { "process.env.SystemRoot": true, @@ -4910,9 +4947,34 @@ "setTimeout": true }, "packages": { + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob": true, "nyc>glob": true } }, + "gulp-watch>chokidar>fsevents>node-pre-gyp>rimraf>glob": { + "builtin": { + "assert": true, + "events.EventEmitter": true, + "fs": true, + "path.join": true, + "path.resolve": true, + "util": true + }, + "globals": { + "console.error": true, + "process.cwd": true, + "process.nextTick": true, + "process.platform": true + }, + "packages": { + "eslint>minimatch": true, + "gulp-watch>path-is-absolute": true, + "nyc>glob>fs.realpath": true, + "nyc>glob>inflight": true, + "pump>once": true, + "pumpify>inherits": true + } + }, "gulp-watch>chokidar>fsevents>node-pre-gyp>semver": { "globals": { "console": true, @@ -8246,14 +8308,7 @@ "path.dirname": true }, "packages": { - "stylelint>file-entry-cache>flat-cache>write>mkdirp": true - } - }, - "stylelint>file-entry-cache>flat-cache>write>mkdirp": { - "builtin": { - "fs": true, - "path.dirname": true, - "path.resolve": true + "@sentry/cli>mkdirp": true } }, "stylelint>global-modules": { diff --git a/package.json b/package.json index 0b6488a47..72188863a 100644 --- a/package.json +++ b/package.json @@ -235,7 +235,7 @@ "@metamask/controller-utils": "^4.0.0", "@metamask/design-tokens": "^1.9.0", "@metamask/desktop": "^0.3.0", - "@metamask/eth-json-rpc-infura": "^8.0.0", + "@metamask/eth-json-rpc-infura": "^8.1.0", "@metamask/eth-json-rpc-middleware": "^11.0.0", "@metamask/eth-json-rpc-provider": "^1.0.0", "@metamask/eth-keyring-controller": "^10.0.1", diff --git a/shared/constants/network.ts b/shared/constants/network.ts index 9e15cffd2..7e7d26d7b 100644 --- a/shared/constants/network.ts +++ b/shared/constants/network.ts @@ -95,7 +95,7 @@ export const NETWORK_TYPES = { MAINNET: 'mainnet', RPC: 'rpc', SEPOLIA: 'sepolia', - LINEA_TESTNET: 'lineatestnet', + LINEA_GOERLI: 'linea-goerli', } as const; /** @@ -121,7 +121,7 @@ export const NETWORK_IDS = { GOERLI: '5', LOCALHOST: '1337', SEPOLIA: '11155111', - LINEA_TESTNET: '59140', + LINEA_GOERLI: '59140', } as const; /** @@ -147,7 +147,7 @@ export const CHAIN_IDS = { HARMONY: '0x63564c40', PALM: '0x2a15c308d', SEPOLIA: '0xaa36a7', - LINEA_TESTNET: '0xe704', + LINEA_GOERLI: '0xe704', AURORA: '0x4e454152', MOONBEAM: '0x504', MOONBEAM_TESTNET: '0x507', @@ -164,7 +164,7 @@ export const MAX_SAFE_CHAIN_ID = 4503599627370476; export const MAINNET_DISPLAY_NAME = 'Ethereum Mainnet'; export const GOERLI_DISPLAY_NAME = 'Goerli'; export const SEPOLIA_DISPLAY_NAME = 'Sepolia'; -export const LINEA_TESTNET_DISPLAY_NAME = 'Linea Goerli test network'; +export const LINEA_GOERLI_DISPLAY_NAME = 'Linea Goerli'; export const LOCALHOST_DISPLAY_NAME = 'Localhost 8545'; export const BSC_DISPLAY_NAME = 'Binance Smart Chain'; export const POLYGON_DISPLAY_NAME = 'Polygon'; @@ -194,7 +194,9 @@ export const MAINNET_RPC_URL = getRpcUrl({ }); export const GOERLI_RPC_URL = getRpcUrl({ network: NETWORK_TYPES.GOERLI }); export const SEPOLIA_RPC_URL = getRpcUrl({ network: NETWORK_TYPES.SEPOLIA }); -export const LINEA_TESTNET_RPC_URL = `https://linea-goerli.infura.io/v3/${infuraProjectId}`; +export const LINEA_GOERLI_RPC_URL = getRpcUrl({ + network: NETWORK_TYPES.LINEA_GOERLI, +}); export const LOCALHOST_RPC_URL = 'http://localhost:8545'; /** @@ -227,6 +229,7 @@ export const CURRENCY_SYMBOLS = { } as const; export const ETH_TOKEN_IMAGE_URL = './images/eth_logo.png'; +export const LINEA_GOERLI_TOKEN_IMAGE_URL = './images/linea-logo-testnet.png'; export const TEST_ETH_TOKEN_IMAGE_URL = './images/black-eth-logo.svg'; export const BNB_TOKEN_IMAGE_URL = './images/bnb.png'; export const MATIC_TOKEN_IMAGE_URL = './images/matic-token.png'; @@ -243,12 +246,13 @@ export const INFURA_PROVIDER_TYPES = [ NETWORK_TYPES.MAINNET, NETWORK_TYPES.GOERLI, NETWORK_TYPES.SEPOLIA, + NETWORK_TYPES.LINEA_GOERLI, ] as const; export const TEST_CHAINS = [ CHAIN_IDS.GOERLI, CHAIN_IDS.SEPOLIA, - CHAIN_IDS.LINEA_TESTNET, + CHAIN_IDS.LINEA_GOERLI, CHAIN_IDS.LOCALHOST, ]; @@ -256,10 +260,7 @@ const typedCapitalize = (k: K): Capitalize => capitalize(k) as Capitalize; export const TEST_NETWORK_TICKER_MAP: { - [K in Exclude< - NetworkType, - 'localhost' | 'mainnet' | 'rpc' - >]: `${Capitalize}${typeof CURRENCY_SYMBOLS.ETH}`; + [K in Exclude]: string; } = { [NETWORK_TYPES.GOERLI]: `${typedCapitalize(NETWORK_TYPES.GOERLI)}${ CURRENCY_SYMBOLS.ETH @@ -267,10 +268,7 @@ export const TEST_NETWORK_TICKER_MAP: { [NETWORK_TYPES.SEPOLIA]: `${typedCapitalize(NETWORK_TYPES.SEPOLIA)}${ CURRENCY_SYMBOLS.ETH }`, - [NETWORK_TYPES.LINEA_TESTNET]: - `Linea${CURRENCY_SYMBOLS.ETH}` as `${Capitalize< - typeof NETWORK_TYPES.LINEA_TESTNET - >}${typeof CURRENCY_SYMBOLS.ETH}`, + [NETWORK_TYPES.LINEA_GOERLI]: `Linea${CURRENCY_SYMBOLS.ETH}`, }; /** @@ -289,11 +287,11 @@ export const BUILT_IN_NETWORKS = { ticker: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.SEPOLIA], blockExplorerUrl: `https://${NETWORK_TYPES.SEPOLIA}.etherscan.io`, }, - [NETWORK_TYPES.LINEA_TESTNET]: { - networkId: NETWORK_IDS.LINEA_TESTNET, - chainId: CHAIN_IDS.LINEA_TESTNET, - ticker: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.LINEA_TESTNET], - blockExplorerUrl: 'https://explorer.goerli.linea.build', + [NETWORK_TYPES.LINEA_GOERLI]: { + networkId: NETWORK_IDS.LINEA_GOERLI, + chainId: CHAIN_IDS.LINEA_GOERLI, + ticker: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.LINEA_GOERLI], + blockExplorerUrl: 'https://goerli.lineascan.build', }, [NETWORK_TYPES.MAINNET]: { networkId: NETWORK_IDS.MAINNET, @@ -317,18 +315,18 @@ export const NETWORK_TO_NAME_MAP = { [NETWORK_TYPES.MAINNET]: MAINNET_DISPLAY_NAME, [NETWORK_TYPES.GOERLI]: GOERLI_DISPLAY_NAME, [NETWORK_TYPES.SEPOLIA]: SEPOLIA_DISPLAY_NAME, - [NETWORK_TYPES.LINEA_TESTNET]: LINEA_TESTNET_DISPLAY_NAME, + [NETWORK_TYPES.LINEA_GOERLI]: LINEA_GOERLI_DISPLAY_NAME, [NETWORK_TYPES.LOCALHOST]: LOCALHOST_DISPLAY_NAME, [NETWORK_IDS.GOERLI]: GOERLI_DISPLAY_NAME, [NETWORK_IDS.SEPOLIA]: SEPOLIA_DISPLAY_NAME, - [NETWORK_IDS.LINEA_TESTNET]: LINEA_TESTNET_DISPLAY_NAME, + [NETWORK_IDS.LINEA_GOERLI]: LINEA_GOERLI_DISPLAY_NAME, [NETWORK_IDS.MAINNET]: MAINNET_DISPLAY_NAME, [NETWORK_IDS.LOCALHOST]: LOCALHOST_DISPLAY_NAME, [CHAIN_IDS.GOERLI]: GOERLI_DISPLAY_NAME, [CHAIN_IDS.SEPOLIA]: SEPOLIA_DISPLAY_NAME, - [CHAIN_IDS.LINEA_TESTNET]: LINEA_TESTNET_DISPLAY_NAME, + [CHAIN_IDS.LINEA_GOERLI]: LINEA_GOERLI_DISPLAY_NAME, [CHAIN_IDS.MAINNET]: MAINNET_DISPLAY_NAME, [CHAIN_IDS.LOCALHOST]: LOCALHOST_DISPLAY_NAME, } as const; @@ -337,20 +335,21 @@ export const CHAIN_ID_TO_TYPE_MAP = { [CHAIN_IDS.MAINNET]: NETWORK_TYPES.MAINNET, [CHAIN_IDS.GOERLI]: NETWORK_TYPES.GOERLI, [CHAIN_IDS.SEPOLIA]: NETWORK_TYPES.SEPOLIA, - [CHAIN_IDS.LINEA_TESTNET]: NETWORK_TYPES.LINEA_TESTNET, + [CHAIN_IDS.LINEA_GOERLI]: NETWORK_TYPES.LINEA_GOERLI, [CHAIN_IDS.LOCALHOST]: NETWORK_TYPES.LOCALHOST, } as const; export const CHAIN_ID_TO_RPC_URL_MAP = { [CHAIN_IDS.GOERLI]: GOERLI_RPC_URL, [CHAIN_IDS.SEPOLIA]: SEPOLIA_RPC_URL, - [CHAIN_IDS.LINEA_TESTNET]: LINEA_TESTNET_RPC_URL, + [CHAIN_IDS.LINEA_GOERLI]: LINEA_GOERLI_RPC_URL, [CHAIN_IDS.MAINNET]: MAINNET_RPC_URL, [CHAIN_IDS.LOCALHOST]: LOCALHOST_RPC_URL, } as const; export const CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP = { [CHAIN_IDS.MAINNET]: ETH_TOKEN_IMAGE_URL, + [CHAIN_IDS.LINEA_GOERLI]: LINEA_GOERLI_TOKEN_IMAGE_URL, [CHAIN_IDS.AVALANCHE]: AVAX_TOKEN_IMAGE_URL, [CHAIN_IDS.BSC]: BNB_TOKEN_IMAGE_URL, [CHAIN_IDS.POLYGON]: MATIC_TOKEN_IMAGE_URL, @@ -366,7 +365,7 @@ export const CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP = { export const NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP = { [NETWORK_IDS.GOERLI]: NETWORK_TYPES.GOERLI, [NETWORK_IDS.SEPOLIA]: NETWORK_TYPES.SEPOLIA, - [NETWORK_IDS.LINEA_TESTNET]: NETWORK_TYPES.LINEA_TESTNET, + [NETWORK_IDS.LINEA_GOERLI]: NETWORK_TYPES.LINEA_GOERLI, [NETWORK_IDS.MAINNET]: NETWORK_NAMES.HOMESTEAD, } as const; @@ -374,7 +373,7 @@ export const CHAIN_ID_TO_NETWORK_ID_MAP = { [CHAIN_IDS.MAINNET]: NETWORK_IDS.MAINNET, [CHAIN_IDS.GOERLI]: NETWORK_IDS.GOERLI, [CHAIN_IDS.SEPOLIA]: NETWORK_IDS.SEPOLIA, - [CHAIN_IDS.LINEA_TESTNET]: NETWORK_IDS.LINEA_TESTNET, + [CHAIN_IDS.LINEA_GOERLI]: NETWORK_IDS.LINEA_GOERLI, [CHAIN_IDS.LOCALHOST]: NETWORK_IDS.LOCALHOST, } as const; @@ -416,10 +415,10 @@ export const ETHERSCAN_SUPPORTED_NETWORKS = { }`, networkId: CHAIN_ID_TO_NETWORK_ID_MAP[CHAIN_IDS.SEPOLIA], }, - [CHAIN_IDS.LINEA_TESTNET]: { - domain: 'linea.build', - subdomain: 'explorer.goerli', - networkId: CHAIN_ID_TO_NETWORK_ID_MAP[CHAIN_IDS.LINEA_TESTNET], + [CHAIN_IDS.LINEA_GOERLI]: { + domain: 'lineascan.build', + subdomain: 'goerli', + networkId: CHAIN_ID_TO_NETWORK_ID_MAP[CHAIN_IDS.LINEA_GOERLI], }, [CHAIN_IDS.BSC]: { domain: 'bscscan.com', @@ -519,7 +518,7 @@ export const BUYABLE_CHAINS_MAP: { | typeof CHAIN_IDS.AVALANCHE_TESTNET | typeof CHAIN_IDS.FANTOM_TESTNET | typeof CHAIN_IDS.MOONBEAM_TESTNET - | typeof CHAIN_IDS.LINEA_TESTNET + | typeof CHAIN_IDS.LINEA_GOERLI | typeof CHAIN_IDS.GOERLI >]: BuyableChainSettings; } = { @@ -688,9 +687,6 @@ export const FEATURED_RPCS: RPCDefinition[] = [ }, ]; -export const SHOULD_SHOW_LINEA_TESTNET_NETWORK = - new Date().getTime() > Date.UTC(2023, 2, 28, 8); - /** * Represents the availability state of the currently selected network. */ diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index 2cde8db97..28609f2f1 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -184,6 +184,7 @@ function defaultFixture() { [CHAIN_IDS.MAINNET]: null, [CHAIN_IDS.GOERLI]: null, [CHAIN_IDS.SEPOLIA]: null, + [CHAIN_IDS.LINEA_GOERLI]: null, }, }, KeyringController: { diff --git a/ui/components/app/loading-network-screen/loading-network-screen.component.js b/ui/components/app/loading-network-screen/loading-network-screen.component.js index 5263f2a0f..baa643858 100644 --- a/ui/components/app/loading-network-screen/loading-network-screen.component.js +++ b/ui/components/app/loading-network-screen/loading-network-screen.component.js @@ -64,8 +64,8 @@ export default class LoadingNetworkScreen extends PureComponent { return t('connectingToGoerli'); case NETWORK_TYPES.SEPOLIA: return t('connectingToSepolia'); - case NETWORK_TYPES.LINEA_TESTNET: - return t('connectingToLineaTestnet'); + case NETWORK_TYPES.LINEA_GOERLI: + return t('connectingToLineaGoerli'); default: return t('connectingTo', [providerId]); } diff --git a/ui/components/app/network-display/network-display.js b/ui/components/app/network-display/network-display.js index 2e07267c0..e3d8392bb 100644 --- a/ui/components/app/network-display/network-display.js +++ b/ui/components/app/network-display/network-display.js @@ -20,6 +20,7 @@ import { useI18nContext } from '../../../hooks/useI18nContext'; import { isNetworkLoading } from '../../../selectors'; import { Icon, IconName, IconSize } from '../../component-library'; import { getProviderConfig } from '../../../ducks/metamask/metamask'; +import { getNetworkLabelKey } from '../../../helpers/utils/i18n-helper'; export default function NetworkDisplay({ indicatorSize, @@ -69,7 +70,7 @@ export default function NetworkDisplay({ label={ networkType === NETWORK_TYPES.RPC ? nickname ?? t('privateNetwork') - : t(networkType) + : t(getNetworkLabelKey(networkType)) } className={classnames('network-display', { 'network-display--disabled': disabled, diff --git a/ui/components/component-library/text/text.stories.tsx b/ui/components/component-library/text/text.stories.tsx index 965348d67..edc3ada37 100644 --- a/ui/components/component-library/text/text.stories.tsx +++ b/ui/components/component-library/text/text.stories.tsx @@ -59,8 +59,8 @@ function renderBackgroundColor(color) { case Color.sepoliaInverse: bgColor = BackgroundColor.sepolia; break; - case Color.lineaTestnetInverse: - bgColor = BackgroundColor.lineaTestnet; + case Color.lineaGoerliInverse: + bgColor = BackgroundColor.lineaGoerli; break; default: bgColor = null; diff --git a/ui/components/multichain/network-list-item/network-list-item.js b/ui/components/multichain/network-list-item/network-list-item.js index 6430fca6d..d4b84ddfc 100644 --- a/ui/components/multichain/network-list-item/network-list-item.js +++ b/ui/components/multichain/network-list-item/network-list-item.js @@ -23,7 +23,7 @@ import { useI18nContext } from '../../../hooks/useI18nContext'; import Tooltip from '../../ui/tooltip/tooltip'; import { GOERLI_DISPLAY_NAME, - LINEA_TESTNET_DISPLAY_NAME, + LINEA_GOERLI_DISPLAY_NAME, SEPOLIA_DISPLAY_NAME, } from '../../../../shared/constants/network'; @@ -33,8 +33,8 @@ function getAvatarNetworkColor(name) { switch (name) { case GOERLI_DISPLAY_NAME: return BackgroundColor.goerli; - case LINEA_TESTNET_DISPLAY_NAME: - return BackgroundColor.lineaTestnet; + case LINEA_GOERLI_DISPLAY_NAME: + return BackgroundColor.lineaGoerli; case SEPOLIA_DISPLAY_NAME: return BackgroundColor.sepolia; default: diff --git a/ui/components/multichain/network-list-menu/network-list-menu.js b/ui/components/multichain/network-list-menu/network-list-menu.js index 0e5dc6d5d..93d8d9e15 100644 --- a/ui/components/multichain/network-list-menu/network-list-menu.js +++ b/ui/components/multichain/network-list-menu/network-list-menu.js @@ -11,14 +11,12 @@ import { setShowTestNetworks, setProviderType, toggleNetworkMenu, - upsertNetworkConfiguration, } from '../../../store/actions'; import { CHAIN_IDS, TEST_CHAINS } from '../../../../shared/constants/network'; import { getShowTestNetworks, getAllEnabledNetworks, getCurrentChainId, - getNetworkConfigurations, } from '../../../selectors'; import Box from '../../ui/box/box'; import ToggleButton from '../../ui/toggle-button'; @@ -38,7 +36,6 @@ import { MetaMetricsContext } from '../../../contexts/metametrics'; import { MetaMetricsEventCategory, MetaMetricsEventName, - MetaMetricsNetworkEventSource, } from '../../../../shared/constants/metametrics'; import { getCompletedOnboarding } from '../../../ducks/metamask/metamask'; @@ -48,7 +45,6 @@ export const NetworkListMenu = ({ onClose }) => { const t = useI18nContext(); const networks = useSelector(getAllEnabledNetworks); const showTestNetworks = useSelector(getShowTestNetworks); - const networkConfigurations = useSelector(getNetworkConfigurations); const currentChainId = useSelector(getCurrentChainId); const dispatch = useDispatch(); const history = useHistory(); @@ -96,29 +92,7 @@ export const NetworkListMenu = ({ onClose }) => { if (network.providerType) { dispatch(setProviderType(network.providerType)); } else { - // Linea needs to be added as a custom network because - // it is not yet supported by Infura. The following lazily - // adds Linea to the custom network configurations object - let networkId = network.id; - if (network.chainId === CHAIN_IDS.LINEA_TESTNET) { - const lineaNetworkConfiguration = Object.values( - networkConfigurations, - ).find( - ({ chainId }) => chainId === CHAIN_IDS.LINEA_TESTNET, - ); - if (lineaNetworkConfiguration) { - networkId = lineaNetworkConfiguration.id; - } else { - networkId = await dispatch( - upsertNetworkConfiguration(network, { - setActive: true, - source: - MetaMetricsNetworkEventSource.CustomNetworkForm, - }), - ); - } - } - dispatch(setActiveNetwork(networkId)); + dispatch(setActiveNetwork(network.id)); } trackEvent({ event: MetaMetricsEventName.NavNetworkSwitched, diff --git a/ui/components/ui/typography/typography.js b/ui/components/ui/typography/typography.js index f62bbac9c..cef5e357d 100644 --- a/ui/components/ui/typography/typography.js +++ b/ui/components/ui/typography/typography.js @@ -33,8 +33,8 @@ export const ValidColors = [ Color.sepolia, Color.goerliInverse, Color.sepoliaInverse, - Color.lineaTestnet, - Color.lineaTestnetInverse, + Color.lineaGoerli, + Color.lineaGoerliInverse, ]; export const ValidTags = [ diff --git a/ui/css/design-system/colors.scss b/ui/css/design-system/colors.scss index 0b3e330bf..07653a1d5 100644 --- a/ui/css/design-system/colors.scss +++ b/ui/css/design-system/colors.scss @@ -41,8 +41,8 @@ $color-map: ( 'sepolia': --color-network-sepolia-default, 'goerli-inverse':--color-network-goerli-inverse, 'sepolia-inverse': --color-network-sepolia-inverse, - 'lineatestnet': --color-network-linea-testnet-default, - 'lineatestnet-inverse': --color-network-linea-testnet-inverse, + 'linea-goerli': --color-network-linea-goerli-default, + 'linea-goerli-inverse': --color-network-linea-goerli-inverse, 'localhost': --color-network-localhost-default, 'transparent': --transparent, 'flask-purple': --color-flask-default, diff --git a/ui/css/utilities/colors.scss b/ui/css/utilities/colors.scss index 7d2e8e7c8..b2ae6f449 100644 --- a/ui/css/utilities/colors.scss +++ b/ui/css/utilities/colors.scss @@ -4,8 +4,8 @@ --mainnet: #29b6af; --inherit: inherit; --transparent: transparent; - --color-network-linea-testnet-default: #000; - --color-network-linea-testnet-inverse: #fcfcfc; + --color-network-linea-goerli-default: #000; + --color-network-linea-goerli-inverse: #fcfcfc; // DO NOT CHANGE // Required for the QR reader to work properly --qr-code-white-background: #fff; diff --git a/ui/helpers/constants/design-system.ts b/ui/helpers/constants/design-system.ts index bfab0accc..f6ceceacd 100644 --- a/ui/helpers/constants/design-system.ts +++ b/ui/helpers/constants/design-system.ts @@ -46,8 +46,8 @@ export enum Color { mainnet = 'mainnet', goerli = 'goerli', sepolia = 'sepolia', - lineaTestnet = 'lineatestnet', - lineaTestnetInverse = 'lineatestnet-inverse', + lineaGoerli = 'linea-goerli', + lineaGoerliInverse = 'linea-goerli-inverse', transparent = 'transparent', localhost = 'localhost', inherit = 'inherit', @@ -77,7 +77,7 @@ export enum BackgroundColor { mainnet = 'mainnet', goerli = 'goerli', sepolia = 'sepolia', - lineaTestnet = 'lineatestnet', + lineaGoerli = 'linea-goerli', transparent = 'transparent', localhost = 'localhost', } @@ -103,7 +103,7 @@ export enum BorderColor { mainnet = 'mainnet', goerli = 'goerli', sepolia = 'sepolia', - lineaTestnet = 'lineatestnet', + lineaGoerli = 'linea-goerli', transparent = 'transparent', localhost = 'localhost', backgroundDefault = 'background-default', // exception for border color when element is meant to look "cut out" @@ -127,8 +127,8 @@ export enum TextColor { inherit = 'inherit', goerli = 'goerli', sepolia = 'sepolia', - lineaTestnet = 'lineatestnet', - lineaTestnetInverse = 'lineatestnet-inverse', + lineaGoerli = 'linea-goerli', + lineaGoerliInverse = 'linea-goerli-inverse', goerliInverse = 'goerli-inverse', sepoliaInverse = 'sepolia-inverse', transparent = 'transparent', @@ -152,8 +152,8 @@ export enum IconColor { inherit = 'inherit', goerli = 'goerli', sepolia = 'sepolia', - lineaTestnet = 'lineatestnet', - lineaTestnetInverse = 'lineatestnet-inverse', + lineaGoerli = 'linea-goerli', + lineaGoerliInverse = 'linea-goerli-inverse', goerliInverse = 'goerli-inverse', sepoliaInverse = 'sepolia-inverse', } diff --git a/ui/helpers/constants/settings.js b/ui/helpers/constants/settings.js index 788d54117..59245f9f4 100644 --- a/ui/helpers/constants/settings.js +++ b/ui/helpers/constants/settings.js @@ -242,9 +242,9 @@ export const SETTINGS_CONSTANTS = [ }, { tabMessage: (t) => t('networks'), - sectionMessage: (t) => t('lineatestnet'), - descriptionMessage: (t) => t('lineatestnet'), - route: `${NETWORKS_ROUTE}#networks-lineatestnet`, + sectionMessage: (t) => t('lineaGoerli'), + descriptionMessage: (t) => t('lineaGoerli'), + route: `${NETWORKS_ROUTE}#networks-linea-goerli`, icon: 'fa fa-plug', }, { diff --git a/ui/helpers/utils/i18n-helper.tsx b/ui/helpers/utils/i18n-helper.tsx index 9c3287ae4..6f8bc478f 100644 --- a/ui/helpers/utils/i18n-helper.tsx +++ b/ui/helpers/utils/i18n-helper.tsx @@ -4,6 +4,7 @@ import log from 'loglevel'; import { Json } from '@metamask/utils'; import * as Sentry from '@sentry/browser'; import getFetchWithTimeout from '../../../shared/modules/fetch-with-timeout'; +import { NETWORK_TYPES } from '../../../shared/constants/network'; const fetchWithTimeout = getFetchWithTimeout(); @@ -165,3 +166,10 @@ async function fetchRelativeTimeFormatData(languageTag: string): Promise { ); return await response.json(); } + +export function getNetworkLabelKey(network: string): string { + if (network === NETWORK_TYPES.LINEA_GOERLI) { + return 'lineaGoerli'; + } + return network; +} diff --git a/ui/helpers/utils/util.js b/ui/helpers/utils/util.js index 58e52cef4..3160e75d3 100644 --- a/ui/helpers/utils/util.js +++ b/ui/helpers/utils/util.js @@ -64,7 +64,7 @@ export function isDefaultMetaMaskChain(chainId) { chainId === CHAIN_IDS.MAINNET || chainId === CHAIN_IDS.GOERLI || chainId === CHAIN_IDS.SEPOLIA || - chainId === CHAIN_IDS.LINEA_TESTNET || + chainId === CHAIN_IDS.LINEA_GOERLI || chainId === CHAIN_IDS.LOCALHOST ) { return true; diff --git a/ui/pages/routes/routes.component.js b/ui/pages/routes/routes.component.js index cbbc65fd1..41946983d 100644 --- a/ui/pages/routes/routes.component.js +++ b/ui/pages/routes/routes.component.js @@ -589,8 +589,8 @@ export default class Routes extends Component { return t('connectingToGoerli'); case NETWORK_TYPES.SEPOLIA: return t('connectingToSepolia'); - case NETWORK_TYPES.LINEA_TESTNET: - return t('connectingToLineaTestnet'); + case NETWORK_TYPES.LINEA_GOERLI: + return t('connectingToLineaGoerli'); default: return t('connectingTo', [providerId]); } diff --git a/ui/pages/settings/networks-tab/networks-form/networks-form.js b/ui/pages/settings/networks-tab/networks-form/networks-form.js index dff339d95..74970e1b7 100644 --- a/ui/pages/settings/networks-tab/networks-form/networks-form.js +++ b/ui/pages/settings/networks-tab/networks-form/networks-form.js @@ -40,6 +40,7 @@ import { } from '../../../../../shared/constants/network'; import { decimalToHex } from '../../../../../shared/modules/conversion.utils'; import { MetaMetricsContext } from '../../../../contexts/metametrics'; +import { getNetworkLabelKey } from '../../../../helpers/utils/i18n-helper'; /** * Attempts to convert the given chainId to a decimal string, for display @@ -90,7 +91,8 @@ const NetworksForm = ({ const t = useI18nContext(); const dispatch = useDispatch(); const { label, labelKey, viewOnly, rpcPrefs } = selectedNetwork; - const selectedNetworkName = label || (labelKey && t(labelKey)); + const selectedNetworkName = + label || (labelKey && t(getNetworkLabelKey(labelKey))); const [networkName, setNetworkName] = useState(selectedNetworkName || ''); const [rpcUrl, setRpcUrl] = useState(selectedNetwork?.rpcUrl || ''); const [chainId, setChainId] = useState(selectedNetwork?.chainId || ''); diff --git a/ui/pages/settings/networks-tab/networks-list-item/networks-list-item.js b/ui/pages/settings/networks-tab/networks-list-item/networks-list-item.js index 8c27b3b83..3256642a3 100644 --- a/ui/pages/settings/networks-tab/networks-list-item/networks-list-item.js +++ b/ui/pages/settings/networks-tab/networks-list-item/networks-list-item.js @@ -4,6 +4,7 @@ import classnames from 'classnames'; import { useDispatch, useSelector } from 'react-redux'; import { useI18nContext } from '../../../../hooks/useI18nContext'; import { + CHAIN_IDS, CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP, NETWORK_TYPES, } from '../../../../../shared/constants/network'; @@ -22,6 +23,7 @@ import { IconSize, } from '../../../../components/component-library'; import { IconColor } from '../../../../helpers/constants/design-system'; +import { getNetworkLabelKey } from '../../../../helpers/utils/i18n-helper'; const NetworksListItem = ({ network, @@ -99,7 +101,7 @@ const NetworksListItem = ({ /> ) )} - {network.isATestNetwork && ( + {network.isATestNetwork && network.chainId !== CHAIN_IDS.LINEA_GOERLI && ( - {label || t(labelKey)} + {label || t(getNetworkLabelKey(labelKey))} {currentProviderType !== NETWORK_TYPES.RPC && ( ({ - ...network, - viewOnly: true, - isATestNetwork: TEST_CHAINS.includes(network.chainId), - })) - .filter((network) => network.chainId !== CHAIN_IDS.LINEA_TESTNET); +const defaultNetworks = defaultNetworksData.map((network) => ({ + ...network, + viewOnly: true, + isATestNetwork: TEST_CHAINS.includes(network.chainId), +})); const NetworksTab = ({ addNewNetwork }) => { const t = useI18nContext(); @@ -73,12 +69,8 @@ const NetworksTab = ({ addNewNetwork }) => { }, ); - let networksToRender = [...defaultNetworks, ...networkConfigurationsList]; - if (!SHOULD_SHOW_LINEA_TESTNET_NETWORK) { - networksToRender = networksToRender.filter( - (network) => network.chainId !== CHAIN_IDS.LINEA_TESTNET, - ); - } + const networksToRender = [...defaultNetworks, ...networkConfigurationsList]; + let selectedNetwork = networksToRender.find( (network) => diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index fdacbe144..8254391dd 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -29,9 +29,10 @@ import { SEPOLIA_DISPLAY_NAME, GOERLI_DISPLAY_NAME, ETH_TOKEN_IMAGE_URL, - LINEA_TESTNET_DISPLAY_NAME, + LINEA_GOERLI_DISPLAY_NAME, CURRENCY_SYMBOLS, TEST_NETWORK_TICKER_MAP, + LINEA_GOERLI_TOKEN_IMAGE_URL, } from '../../shared/constants/network'; import { WebHIDConnectedStatuses, @@ -1175,13 +1176,7 @@ export function getAllNetworks(state) { }, // Custom networks added by the user ...Object.values(networkConfigurations).filter( - ({ chainId }) => - ![ - CHAIN_IDS.LOCALHOST, - // Linea gets added as a custom network configuration so - // we must ignore it here to display in test networks - CHAIN_IDS.LINEA_TESTNET, - ].includes(chainId), + ({ chainId }) => ![CHAIN_IDS.LOCALHOST].includes(chainId), ), // Test networks { @@ -1199,10 +1194,14 @@ export function getAllNetworks(state) { ticker: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.SEPOLIA], }, { - chainId: CHAIN_IDS.LINEA_TESTNET, - nickname: LINEA_TESTNET_DISPLAY_NAME, - rpcUrl: CHAIN_ID_TO_RPC_URL_MAP[CHAIN_IDS.LINEA_TESTNET], - ticker: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.LINEA_TESTNET], + chainId: CHAIN_IDS.LINEA_GOERLI, + nickname: LINEA_GOERLI_DISPLAY_NAME, + rpcUrl: CHAIN_ID_TO_RPC_URL_MAP[CHAIN_IDS.LINEA_GOERLI], + rpcPrefs: { + imageUrl: LINEA_GOERLI_TOKEN_IMAGE_URL, + }, + providerType: NETWORK_TYPES.LINEA_GOERLI, + ticker: TEST_NETWORK_TICKER_MAP[NETWORK_TYPES.LINEA_GOERLI], }, // Localhosts ...Object.values(networkConfigurations).filter( diff --git a/yarn.lock b/yarn.lock index 3b8a772e3..64b945686 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4122,16 +4122,16 @@ __metadata: languageName: node linkType: hard -"@metamask/eth-json-rpc-infura@npm:^8.0.0": - version: 8.0.0 - resolution: "@metamask/eth-json-rpc-infura@npm:8.0.0" +"@metamask/eth-json-rpc-infura@npm:^8.0.0, @metamask/eth-json-rpc-infura@npm:^8.1.0": + version: 8.1.0 + resolution: "@metamask/eth-json-rpc-infura@npm:8.1.0" dependencies: "@metamask/utils": ^3.0.1 eth-json-rpc-middleware: ^9.0.0 eth-rpc-errors: ^4.0.3 json-rpc-engine: ^6.1.0 node-fetch: ^2.6.7 - checksum: e8c3a4b75d4f2bb09f68d7d2ac6b992f264df893921b50a05c35968ee684b7bba90180870eebecfc89b7fbf40d11de2a545ab68f1d511f569ce0a6519c64b0aa + checksum: fd09383e2b3c16187b8889b53bfc431fc7ea4f6483acc23ddf77f2fd771ad0fbff41d6a62d4b05833e7cda66adafe0cb3730d7c0e9575b89683b71a82ab1ee1f languageName: node linkType: hard @@ -24048,7 +24048,7 @@ __metadata: "@metamask/eslint-config-mocha": ^9.0.0 "@metamask/eslint-config-nodejs": ^9.0.0 "@metamask/eslint-config-typescript": ^9.0.1 - "@metamask/eth-json-rpc-infura": ^8.0.0 + "@metamask/eth-json-rpc-infura": ^8.1.0 "@metamask/eth-json-rpc-middleware": ^11.0.0 "@metamask/eth-json-rpc-provider": ^1.0.0 "@metamask/eth-keyring-controller": ^10.0.1