mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
Add signature request warning modal (#16225)
* Add signature request warning modal Fix e2e tests Fix e2e tests Remove warning message from eth sign request Remove unused locales Fix e2e test Fix e2e test * Run pipeline * Fix locales: ? * Add unit tests
This commit is contained in:
parent
08ddd4fb0c
commit
dd0844e200
3
app/_locales/am/messages.json
generated
3
app/_locales/am/messages.json
generated
@ -810,9 +810,6 @@
|
||||
"sign": {
|
||||
"message": "ፈርም"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "ይህን መልዕክት መፈረም አደገኛ ውጤቶች \nሊኖሩት ይችላሉ። በሙሉ መለያዎ ሙሉ በሙሉ ከሚያምኗቸው\nድረ ገጾች የሚመጡ መልዕክቶችን ብቻ ይፈርሙ።\nይህ አደገኛ ዘዴ ከወደፊት ስሪት ይወገዳል።"
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "የፊርማ ጥያቄ"
|
||||
},
|
||||
|
3
app/_locales/ar/messages.json
generated
3
app/_locales/ar/messages.json
generated
@ -826,9 +826,6 @@
|
||||
"sign": {
|
||||
"message": "توقيع"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "توقيع هذه الرسالة يمكن أن يكون له\nآثار جانبية خطيرة. قم فقط بتوقيع الرسائل من\nالمواقع التي تثق بها تماماً في التعامل مع حسابك بالكامل.\n ستتم إزالة هذه الطريقة الخطيرة في إصدار مستقبلي."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "طلب التوقيع"
|
||||
},
|
||||
|
3
app/_locales/bg/messages.json
generated
3
app/_locales/bg/messages.json
generated
@ -821,9 +821,6 @@
|
||||
"sign": {
|
||||
"message": "Подпис"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Подписването на това съобщение може да има\nопасни странични ефекти. Подписвайте само съобщения от\nсайтове, на които имате пълно доверие с целия си акаунт.\nТози опасен метод ще бъде премахнат в бъдеща версия."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Заявка за подпис"
|
||||
},
|
||||
|
3
app/_locales/bn/messages.json
generated
3
app/_locales/bn/messages.json
generated
@ -825,9 +825,6 @@
|
||||
"sign": {
|
||||
"message": "স্বাক্ষর করুন"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "এই বার্তাটিতে সাইন আইন করার \nবিপজ্জনক পার্শ্ব প্রতিক্রিয়া থাকতে পারে। আপনি সম্পূর্ণ বিশ্বাস করেন শুধুমাত্র সেই \nসাইটের থেকে আসা বার্তাগুলিতেই আপনার সামগ্রিক অ্যাকাউন্টের মাধ্যমে সাইন করুন।\n এই বিপজ্জনক পদ্ধতিটি পরবর্তী সংস্করণে অপসারণ করা হবে। "
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "স্বাক্ষরের অনুরোধ"
|
||||
},
|
||||
|
3
app/_locales/ca/messages.json
generated
3
app/_locales/ca/messages.json
generated
@ -803,9 +803,6 @@
|
||||
"sign": {
|
||||
"message": "Signar"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Signar aquest missatge pot tenir efectes secundaris perillosos. Signa només els missatges de llocs en els quals confiïs plenament amb la totalitat del teu compte. Aquest mètode perillós serà retirat en versions posteriors."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Sol·licitud de Signatura"
|
||||
},
|
||||
|
3
app/_locales/cs/messages.json
generated
3
app/_locales/cs/messages.json
generated
@ -334,9 +334,6 @@
|
||||
"sign": {
|
||||
"message": "Podepsat"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Podepsání zprávy může mít \nnebezpečný vedlejší učinek. Podepisujte zprávy pouze ze \nstránek, kterým plně důvěřujete celým svým účtem.\n Tato nebezpečná metoda bude odebrána v budoucí verzi. "
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Požadavek podpisu"
|
||||
},
|
||||
|
3
app/_locales/da/messages.json
generated
3
app/_locales/da/messages.json
generated
@ -803,9 +803,6 @@
|
||||
"sign": {
|
||||
"message": "Underskriv"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Underskrivning af denne besked kan have farlige sideeffekter. Skriv kun under på beskeder fra sider, du har fuld tillid til med hele din konto.\nDenne farlige metode bliver fjernet i en fremtidig version."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Signaturforespørgsel"
|
||||
},
|
||||
|
3
app/_locales/de/messages.json
generated
3
app/_locales/de/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "Unterschreiben"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Das Unterschreiben dieser Nachricht kann gefährliche Nebeneffekte haben. Bitte nur Nachrichten von Webseiten unterschreiben denen du deinen vollständigen Account anvertrauen würdest. Diese gefährliche Variante wird in zukünftigen Versionen entfernt werden."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Unterschriftsanfrage"
|
||||
},
|
||||
|
3
app/_locales/el/messages.json
generated
3
app/_locales/el/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "Υπογραφή"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Η υπογραφή αυτού του μηνύματος μπορεί να έχει\nεπικίνδυνες παρενέργειες. Υπογράφετε μηνύματα μόνο από\nτοποθεσίες που εμπιστεύεστε πλήρως με ολόκληρο τον λογαριασμό σας.\n Αυτή η επικίνδυνη μέθοδος θα καταργηθεί σε μια μελλοντική έκδοση."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Αίτημα Υπογραφής"
|
||||
},
|
||||
|
9
app/_locales/en/messages.json
generated
9
app/_locales/en/messages.json
generated
@ -3276,15 +3276,15 @@
|
||||
"sign": {
|
||||
"message": "Sign"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Signing this message can be dangerous. This signature could potentially perform any operation on your account's behalf, including granting complete control of your account and all of its assets to the requesting site. Only sign this message if you know what you're doing or completely trust the requesting site."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Signature request"
|
||||
},
|
||||
"signatureRequest1": {
|
||||
"message": "Message"
|
||||
},
|
||||
"signatureRequestWarning": {
|
||||
"message": "Signing this message could be dangerous. You may be giving total control of your account and assets to the party on the other end of this message. That means they could drain your account at any time. Proceed with caution. $1."
|
||||
},
|
||||
"signed": {
|
||||
"message": "Signed"
|
||||
},
|
||||
@ -4484,6 +4484,9 @@
|
||||
"youSign": {
|
||||
"message": "You are signing"
|
||||
},
|
||||
"yourFundsMayBeAtRisk": {
|
||||
"message": "Your funds may be at risk"
|
||||
},
|
||||
"yourPrivateSeedPhrase": {
|
||||
"message": "Your private Secret Recovery Phrase"
|
||||
},
|
||||
|
3
app/_locales/es/messages.json
generated
3
app/_locales/es/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "Firmar"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Firmar este mensaje puede tener \nefectos secundarios peligrosos. Firme solo los mensajes de \nsitios en los que confía totalmente con toda su cuenta.\n Este método peligroso se quitará en una versión futura. "
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Solicitud de firma"
|
||||
},
|
||||
|
3
app/_locales/es_419/messages.json
generated
3
app/_locales/es_419/messages.json
generated
@ -2418,9 +2418,6 @@
|
||||
"sign": {
|
||||
"message": "Firmar"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Firmar este mensaje puede ser peligroso. Esta firma podría realizar potencialmente cualquier operación en nombre de su cuenta, incluida la concesión del control total de tu cuenta y de todos sus activos al sitio solicitante. Solo firme este mensaje si sabe lo que está haciendo o confía plenamente en el sitio solicitante."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Solicitud de firma"
|
||||
},
|
||||
|
3
app/_locales/et/messages.json
generated
3
app/_locales/et/messages.json
generated
@ -815,9 +815,6 @@
|
||||
"sign": {
|
||||
"message": "Allkirjasta"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Selle sõnumi allkirjastamisel \nvõib olla ohtlikke kõrvaltoimeid. Allkirjastage sõnumeid vaid \nsaitidelt, mida te kogu kontoga usaldate.\n See ohtlik meetod eemaldatakse uues versioonis."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Allkirja taotlus"
|
||||
},
|
||||
|
3
app/_locales/fa/messages.json
generated
3
app/_locales/fa/messages.json
generated
@ -825,9 +825,6 @@
|
||||
"sign": {
|
||||
"message": "علامت"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "علامت کردن این پیام میتواند\nعوارض جانبی داشته باشد. تنها پیام های را که\nاز سایت های که کاملًا اعتماد داشته باشید با حساب خود علامت بزنید.\nاین روش خطرناک در نسخه آینده از بین برده خواهد شد."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "درخواست امضاء"
|
||||
},
|
||||
|
3
app/_locales/fi/messages.json
generated
3
app/_locales/fi/messages.json
generated
@ -822,9 +822,6 @@
|
||||
"sign": {
|
||||
"message": "Allekirjoita"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Tämän viestin allekirjoittamisella voi olla\nvaarallisia sivuvaikutuksia. Allekirjoita viestejä ainoastaan\nsivustoilta, joihin luotat täysin koko tililläsi.\n Tällainen vaarallinen menetelmä poistetaan tulevista versioista."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Allekirjoitus pyydetään"
|
||||
},
|
||||
|
3
app/_locales/fil/messages.json
generated
3
app/_locales/fil/messages.json
generated
@ -749,9 +749,6 @@
|
||||
"sign": {
|
||||
"message": "I-sign"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Kapag na-sign ang mensaheng ito, maaaring magkaroon \nng mapapanganib na side effect. Mag-sign lang ng mga mensaheng mula \nsa mga site na ganap mong pinagkakatiwalaang gumamit sa iyong account.\n Isa itong mapanganib na method na aalisin sa isang bersyon sa hinaharap. "
|
||||
},
|
||||
"signed": {
|
||||
"message": "Na-sign"
|
||||
},
|
||||
|
3
app/_locales/fr/messages.json
generated
3
app/_locales/fr/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "Signer"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "La signature de ce message peut avoir des effets secondaires dangereux, interférant en votre nom via le contrôle de votre compte et de ses actifs par le site demandeur. Signez uniquement les messages de sites auxquels vous faites entièrement confiance."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Demande de Signature"
|
||||
},
|
||||
|
3
app/_locales/he/messages.json
generated
3
app/_locales/he/messages.json
generated
@ -822,9 +822,6 @@
|
||||
"sign": {
|
||||
"message": "חתימה"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "לחתימה על הודעה זו יכולות להיות תוצאות לוואי מסוכנות. מומלץ לחתום רק הודעות מאתרים שיש לך אמון מלא בהם והפקדת את כל החשבון שלך בידיהם. השיטה המסוכנת תוסר בגרסה עתידית."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "בקשת חתימה"
|
||||
},
|
||||
|
3
app/_locales/hi/messages.json
generated
3
app/_locales/hi/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "हस्ताक्षर करें"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "इस संदेश पर हस्ताक्षर करना खतरनाक हो सकता है। यह हस्ताक्षर संभावित रूप से आपके खाते की ओर से कोई भी संचालन कर सकता है, जिसमें अनुरोध करने वाली साइट को आपके खाते और उसकी सभी संपत्तियों पर पूर्ण नियंत्रण प्रदान करना शामिल है। इस संदेश पर केवल तभी हस्ताक्षर करें जब आप जानते हों कि आप क्या कर रहे हैं या अनुरोध करने वाली साइट पर पूरा भरोसा है"
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "हस्ताक्षर का अनुरोध"
|
||||
},
|
||||
|
3
app/_locales/hn/messages.json
generated
3
app/_locales/hn/messages.json
generated
@ -308,9 +308,6 @@
|
||||
"sign": {
|
||||
"message": "हस्ताक्षर"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "इस संदेश पर हस्ताक्षर करने से \n साइड इफेक्ट हो सकते हैं। \n केवल अपने पूरे खाते के साथ पूरी तरह से भरोसेमंद \n साइटों से संदेश पर हस्ताक्षर करें। \n यह खतरनाक विधि भविष्य के संस्करण में निकाल दी जाएगी।"
|
||||
},
|
||||
"stateLogs": {
|
||||
"message": "स्थिति संदेश"
|
||||
},
|
||||
|
3
app/_locales/hr/messages.json
generated
3
app/_locales/hr/messages.json
generated
@ -818,9 +818,6 @@
|
||||
"sign": {
|
||||
"message": "Potpis"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Potpisivanje ove poruke može\nimati opasne neželjene učinke. Samo potpisujte poruke\ns mrežnih mjesta u koja imate potpuno povjerenje kada je riječ o vašem cijelom računu.\nOvaj se opasni način uklanja u sljedećoj inačici."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Zahtjev za potpisom"
|
||||
},
|
||||
|
3
app/_locales/ht/messages.json
generated
3
app/_locales/ht/messages.json
generated
@ -536,9 +536,6 @@
|
||||
"sign": {
|
||||
"message": "Siyen"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Lè w siyen mesaj sa a ka gen efè segondè ki \ndanjere. Sèlman \nsit mesaj ki soti nan sit ou konplètman fè konfyans ak tout kont ou. \n Metòd danjere sa yo pral retire nan yon vèsyon fiti. "
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Siyati Mande"
|
||||
},
|
||||
|
3
app/_locales/hu/messages.json
generated
3
app/_locales/hu/messages.json
generated
@ -818,9 +818,6 @@
|
||||
"sign": {
|
||||
"message": "Aláír"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Az üzenet aláírása veszélyes következményekkel járhat. Csak olyan webhely üzenetét írja alá, amelyben teljes mértékben és a teljes fiókjával megbízik. Ezt a veszélyes módszert egy későbbi verzióból eltávolítjuk."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Aláírási kérelem"
|
||||
},
|
||||
|
3
app/_locales/id/messages.json
generated
3
app/_locales/id/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "Tanda tangan"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Menandatangani pesan ini bisa berakibat fatal. Tanda tangan ini berpotensi melakukan operasi atas nama akun Anda, termasuk memberikan kendali penuh atas akun Anda dan semua asetnya ke situs yang meminta tindakan ini. Hanya tanda tangani pesan ini jika Anda tahu apa yang Anda lakukan atau sepenuhnya memercayai situs yang meminta."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Permintaan tanda tangan"
|
||||
},
|
||||
|
3
app/_locales/it/messages.json
generated
3
app/_locales/it/messages.json
generated
@ -1787,9 +1787,6 @@
|
||||
"sign": {
|
||||
"message": "Firma"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Firmare questo messaggio può avere effetti collaterali pericolosi. \nFirma messaggi da siti di cui ti fidi totalmente. \nQuesto metodo pericoloso sarà rimosso in versioni future."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Firma Richiesta"
|
||||
},
|
||||
|
3
app/_locales/ja/messages.json
generated
3
app/_locales/ja/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "署名"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "このメッセージに署名すると、危険な可能性があります。この署名により、要求しているサイトへのアカウントやアカウントのアセットの完全な管理権の付与を含め、アカウントに代わり操作が行われる可能性があります。完全に状況を把握している場合、または要求しているサイトを完全に信頼している場合を除き、このメッセージには署名しないでください。"
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "署名の要求"
|
||||
},
|
||||
|
3
app/_locales/kn/messages.json
generated
3
app/_locales/kn/messages.json
generated
@ -825,9 +825,6 @@
|
||||
"sign": {
|
||||
"message": "ಸಹಿ"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "ಈ ಸಂದೇಶಕ್ಕೆ ಸಹಿ ಮಾಡುವಿಕೆಯು \nಅಪಾಯಕಾರಿ ಅಡ್ಡಪರಿಣಾಮಗಳನ್ನು ಹೊಂದಿರಬಹುದು. ನಿಮ್ಮ ಸಂಪೂರ್ಣ ಖಾತೆಯೊಂದಿಗೆ ನೀವು ಸಂಪೂರ್ಣವಾಗಿ ನಂಬುವ ಸೈಟ್ಗಳಿಂದ\nಮಾತ್ರ ಸಂದೇಶಗಳಿಗೆ ಸಹಿ ಮಾಡಿ.\nಭವಿಷ್ಯದ ಆವೃತ್ತಿಯಲ್ಲಿ ಈ ಅಪಾಯಕಾರಿ ವಿಧಾನವನ್ನು ತೆಗೆದುಹಾಕಲಾಗುತ್ತದೆ."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "ಸಹಿಯ ವಿನಂತಿ"
|
||||
},
|
||||
|
3
app/_locales/ko/messages.json
generated
3
app/_locales/ko/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "서명"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "본 메시지에 서명하는 행위는 위험의 가능성을 내포하고 있습니다. 본 서명을 이용하여 사이트에 요청하면 귀하의 계정 및 모든 자산에 대해 완전한 권한을 부여함은 물론 귀하의 계정과 관련된 실질적 모든 작업을 수행할 가능성이 있기 때문입니다. 완전히 신뢰할 수 있는 사이트에서 확실한 작업을 수행할 경우에만 본 메시지에 서명하십시오."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "서명 요청"
|
||||
},
|
||||
|
3
app/_locales/lt/messages.json
generated
3
app/_locales/lt/messages.json
generated
@ -825,9 +825,6 @@
|
||||
"sign": {
|
||||
"message": "Prisijunkite"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Pasirašant šį pranešimą gali būti \npavojingų šalutinių efektų. Pasirašykite tik pranešimus iš vietų,\nkuriomis visiškai pasitikite su visomis savo paskyromis.\nŠis pavojingas būdas bus pašalintas ateities versijoje. "
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Parašo užklausa"
|
||||
},
|
||||
|
3
app/_locales/lv/messages.json
generated
3
app/_locales/lv/messages.json
generated
@ -821,9 +821,6 @@
|
||||
"sign": {
|
||||
"message": "Parakstīt"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Šī ziņojuma parakstīšana var radīt \nbīstamas blaknes. Parakstiet tikai tādus ziņojumus,\nkuriem pilnībā uzticaties ar savu konta informāciju.\n Turpmākajās versijās šī bīstamā metode tiks noņemta. "
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Paraksta pieprasījums"
|
||||
},
|
||||
|
3
app/_locales/ms/messages.json
generated
3
app/_locales/ms/messages.json
generated
@ -805,9 +805,6 @@
|
||||
"sign": {
|
||||
"message": "Tandatangan"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Menandatangani mesej ini boleh menyebabkan kesan sampingan yang berbahaya. Hanya tandatangan mesej daripada tapak yang anda percayai sepenuhnya dengan seluruh akaun anda. Kaedah berbahaya ini akan dibuang dalam versi akan datang."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Permintaan Tandatangan"
|
||||
},
|
||||
|
3
app/_locales/nl/messages.json
generated
3
app/_locales/nl/messages.json
generated
@ -298,9 +298,6 @@
|
||||
"sign": {
|
||||
"message": "Teken"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Het ondertekenen van dit bericht kan hebben \ngevaarlijke bijwerkingen. Meld alleen berichten van \nsites die u volledig vertrouwt met uw volledige account.\n Deze gevaarlijke methode wordt in een toekomstige versie verwijderd."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Ondertekeningsverzoek"
|
||||
},
|
||||
|
3
app/_locales/no/messages.json
generated
3
app/_locales/no/messages.json
generated
@ -809,9 +809,6 @@
|
||||
"sign": {
|
||||
"message": "Undertegn"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Signering av denne meldingen kan ha\nfarlige konsekvenser. Signér kun meldinger fra\nnettsteder du stoler fullt og helt på med hele kontoen din. Denne farlige metoden vil bli fjernet i en fremtidig versjon."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Signaturforespørsel"
|
||||
},
|
||||
|
3
app/_locales/ph/messages.json
generated
3
app/_locales/ph/messages.json
generated
@ -1552,9 +1552,6 @@
|
||||
"sign": {
|
||||
"message": "Lumagda"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Puwedeng may mga \nmapanganib na side effect ang paglagda sa mensaheng ito. Lagdaan lang ang mga mensahe mula sa \nmga site na pinagkakatiwalaan mo para sa buong account mo.\n Aalisin ang mapanganib na paraang ito sa bersyon sa hinaharap. "
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Request ng Signature"
|
||||
},
|
||||
|
3
app/_locales/pl/messages.json
generated
3
app/_locales/pl/messages.json
generated
@ -819,9 +819,6 @@
|
||||
"sign": {
|
||||
"message": "Podpisz"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Podpisanie tej wiadomości może mieć \nniebezpieczne skutki uboczne. Podpisuj wiadomości \ntylko ze stron, którym chcesz udostępnić swoje konto.\nTa niebezpieczna metoda będzie usunięta w przyszłych wersjach. "
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Prośba o podpis"
|
||||
},
|
||||
|
3
app/_locales/pt/messages.json
generated
3
app/_locales/pt/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "Assinar"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Assinar esta mensagem pode ter \nefeitos laterais perigosos. Apenas assine mensagens de sites que \ntotalmente confia com a sua conta total.\n Este método perigoso será removido numa versão posterior."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Pedido de assinatura"
|
||||
},
|
||||
|
3
app/_locales/pt_BR/messages.json
generated
3
app/_locales/pt_BR/messages.json
generated
@ -2402,9 +2402,6 @@
|
||||
"sign": {
|
||||
"message": "Assinar"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Assinar essa mensagem pode ser perigoso. Essa assinatura pode potencialmente realizar qualquer operação em seu nome, incluindo a concessão do controle total da sua conta e de todos os seus ativos ao site solicitante. Apenas assine essa mensagem se você sabe o que está fazendo ou se confia plenamente no site solicitante."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Solicitação de assinatura"
|
||||
},
|
||||
|
3
app/_locales/ro/messages.json
generated
3
app/_locales/ro/messages.json
generated
@ -812,9 +812,6 @@
|
||||
"sign": {
|
||||
"message": "Semnați"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Semnarea acestui mesaj poate avea efecte secundare periculoase. Semnați mesajele numai de pe site-urile în care aveți încredere deplină să vă acceseze întregul cont. Această metodă periculoasă va fi eliminată într-o versiune viitoare."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Cerere semnătură"
|
||||
},
|
||||
|
3
app/_locales/ru/messages.json
generated
3
app/_locales/ru/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "Подписать"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Подписание этого сообщения может быть опасным. Эта подпись потенциально позволяет выполнить любую операцию от имени вашего счета, включая предоставление полного контроля над вашим счетом и всеми его активами запрашивающему сайту. Подписывайте это сообщение, только если вы знаете, что делаете, или полностью доверяете запрашивающему сайту."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Запрос подписи"
|
||||
},
|
||||
|
3
app/_locales/sk/messages.json
generated
3
app/_locales/sk/messages.json
generated
@ -797,9 +797,6 @@
|
||||
"sign": {
|
||||
"message": "Podepsat"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Podepsání zprávy může mít \nnebezpečný vedlejší učinek. Podepisujte zprávy pouze ze \nstránek, kterým plně důvěřujete celým svým účtem.\n Tato nebezpečná metoda bude odebrána v budoucí verzi. "
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Požadavek podpisu"
|
||||
},
|
||||
|
3
app/_locales/sl/messages.json
generated
3
app/_locales/sl/messages.json
generated
@ -813,9 +813,6 @@
|
||||
"sign": {
|
||||
"message": "Podpiši"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "To podpisovanje lahko povzroči \nnevarne stranske učinke. Podpisujte samo sporočila \nstrani, ki jim zaupate s svojim celotnim računom.\n Ta nevarna funkcija bo odstranjena v prihodnji različici. "
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Zahteva za podpis"
|
||||
},
|
||||
|
3
app/_locales/sr/messages.json
generated
3
app/_locales/sr/messages.json
generated
@ -816,9 +816,6 @@
|
||||
"sign": {
|
||||
"message": "Potpišite"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Potpisivanje ove poruke može imati \nopasne neželjene efekte. Potpisujte samo poruke sa \nsajtova u koje imate potpuno poverenje u pogledu svog naloga.\n Ovaj opasan metod će biti uklonjen u budućoj verziji."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Zahtev za potpis"
|
||||
},
|
||||
|
3
app/_locales/sv/messages.json
generated
3
app/_locales/sv/messages.json
generated
@ -809,9 +809,6 @@
|
||||
"sign": {
|
||||
"message": "Signera"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Att signera det här meddelandet kan få farliga följder. Signera endast meddelanden från sidor du vågar anförtro hela ditt konto åt. Den här farliga metoden kommer att avlägsnas i kommande versioner."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Signaturbegäran"
|
||||
},
|
||||
|
3
app/_locales/sw/messages.json
generated
3
app/_locales/sw/messages.json
generated
@ -803,9 +803,6 @@
|
||||
"sign": {
|
||||
"message": "Ingia kwenye akaunti"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Kusaini ujumbe huu kunaweza kuwa \nmadhara hatari. Saini ujumbe kutoka kwenye\ntovuti unazoziamini kabisa na akaunti yako yote tu.\nNjia hii ya hatari itaondolewa kwenye toleo la baadaye."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Ombi la Saini"
|
||||
},
|
||||
|
3
app/_locales/ta/messages.json
generated
3
app/_locales/ta/messages.json
generated
@ -410,9 +410,6 @@
|
||||
"sign": {
|
||||
"message": "உள்நுழை"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "இந்த செய்தியில் கையொப்பமிடலாம் \nஆபத்தான பக்க விளைவுகள் இருக்கலாம். \n உங்கள் மொத்த கணக்கில் முழுமையாக நம்பக்கூடிய தளங்களில் செய்திகளை மட்டுமே கையொப்பமிடுங்கள். \n இந்த ஆபத்தான முறை எதிர்கால பதிப்பில் அகற்றப்படும்."
|
||||
},
|
||||
"signed": {
|
||||
"message": "கையொப்பமிடப்பட்ட"
|
||||
},
|
||||
|
3
app/_locales/th/messages.json
generated
3
app/_locales/th/messages.json
generated
@ -404,9 +404,6 @@
|
||||
"sign": {
|
||||
"message": "เซ็นชื่อ"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "การเซ็นชื่อในข้อความนี้อาจจะเป็นอันตรายได้ \nเซ็นชื่อเฉพาะข้อความจากแหล่งที่คุณไว้วางใจได้จริง ๆ เท่านั้น \nวิธีที่อันตรายนี้จะถูกลบออกในอนาคต"
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "ขอลายเซ็น"
|
||||
},
|
||||
|
3
app/_locales/tl/messages.json
generated
3
app/_locales/tl/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "Lumagda"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Maaaring may mga \nmapanganib na side effect ang paglagda sa mensaheng ito. Lagdaan lang ang mga mensahe mula sa \nmga site na pinagkakatiwalaan mo para sa buong account mo.\n Tatanggalin ang mapanganib na paraang ito sa bersyon sa hinaharap."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Request na Paglagda"
|
||||
},
|
||||
|
3
app/_locales/tr/messages.json
generated
3
app/_locales/tr/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "İmza"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Bu mesajı imzalamak tehlikeli olabilir. Bu imza, hesabınızın tüm kontrolünü ve tüm varlıklarını talepte bulunan siteye vermek de dahil olmak üzere hesabınızın adına potansiyel olarak herhangi bir işlem gerçekleştirebilir. Sadece ne yaptığınızı biliyorsanız veya talepte bulunan siteye tamamen güveniyorsanız bu mesajı imzalayın."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "İmza Talebi"
|
||||
},
|
||||
|
3
app/_locales/uk/messages.json
generated
3
app/_locales/uk/messages.json
generated
@ -825,9 +825,6 @@
|
||||
"sign": {
|
||||
"message": "Підписати"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Підписування цього повідомлення може мати небезпечний побічний ефект. Підписуйте тільки повідомлення від сайтів, яким ви повністю довіряєте весь ваш обліковий запис. Цей небезпечний метод буде усунуто у майбутній версії."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Запит підпису"
|
||||
},
|
||||
|
3
app/_locales/vi/messages.json
generated
3
app/_locales/vi/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "Ký"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "Việc ký vào thông báo này có thể gây nguy hiểm. Chữ ký này có thể được dùng để thực hiện bất kỳ hành động nào thay mặt cho tài khoản của bạn, bao gồm cả cấp toàn quyền kiểm soát tài khoản và tất cả tài sản bên trong cho trang web yêu cầu. Chỉ ký vào thông báo này nếu bạn biết mình đang làm gì hoặc hoàn toàn tin tưởng trang web yêu cầu."
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "Yêu cầu chữ ký"
|
||||
},
|
||||
|
3
app/_locales/zh_CN/messages.json
generated
3
app/_locales/zh_CN/messages.json
generated
@ -3139,9 +3139,6 @@
|
||||
"sign": {
|
||||
"message": "签名"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "谨慎行事。此操作有可能用来从您的账户提取资产。确保您信任此站点。"
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "签名请求"
|
||||
},
|
||||
|
3
app/_locales/zh_TW/messages.json
generated
3
app/_locales/zh_TW/messages.json
generated
@ -1441,9 +1441,6 @@
|
||||
"sign": {
|
||||
"message": "簽署"
|
||||
},
|
||||
"signNotice": {
|
||||
"message": "簽署此訊息可能會產生危險的副作用。\n請只從您完全信任的網站上簽署。\n這種危險的方法將在未來的版本中被移除。"
|
||||
},
|
||||
"signatureRequest": {
|
||||
"message": "請求簽署"
|
||||
},
|
||||
|
@ -55,7 +55,9 @@ describe('Eth sign', function () {
|
||||
assert.equal(personalMessage, expectedPersonalMessage);
|
||||
|
||||
await driver.clickElement('[data-testid="request-signature__sign"]');
|
||||
|
||||
await driver.clickElement(
|
||||
'.signature-request-warning__footer__sign-button',
|
||||
);
|
||||
// Switch to the Dapp
|
||||
await driver.waitUntilXWindowHandles(2);
|
||||
windowHandles = await driver.getAllWindowHandles();
|
||||
|
@ -63,6 +63,7 @@
|
||||
@import 'signature-request/index';
|
||||
@import 'signature-request-siwe/index';
|
||||
@import 'signature-request-original/index';
|
||||
@import 'signature-request-original/signature-request-original-warning/index';
|
||||
@import 'srp-input/srp-input';
|
||||
@import 'tab-bar/index';
|
||||
@import 'token-cell/token-cell';
|
||||
|
@ -143,14 +143,9 @@ exports[`SignatureRequestOriginal should match snapshot 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="request-signature__notice request-signature__warning"
|
||||
class="request-signature__notice"
|
||||
>
|
||||
Signing this message can be dangerous. This signature could potentially perform any operation on your account's behalf, including granting complete control of your account and all of its assets to the requesting site. Only sign this message if you know what you're doing or completely trust the requesting site.
|
||||
<span
|
||||
class="request-signature__help-link"
|
||||
>
|
||||
Learn more
|
||||
</span>
|
||||
You are signing:
|
||||
</div>
|
||||
<div
|
||||
class="request-signature__rows"
|
||||
|
@ -190,10 +190,6 @@
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
&__warning {
|
||||
color: var(--color-error-default);
|
||||
}
|
||||
|
||||
&__rows {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
|
@ -0,0 +1 @@
|
||||
export { default } from './signature-request-original-warning';
|
@ -0,0 +1,27 @@
|
||||
.signature-request-warning {
|
||||
&__content {
|
||||
&__header {
|
||||
border-bottom: 1px solid var(--color-border-muted);
|
||||
|
||||
&__warning-icon {
|
||||
padding-top: 7px;
|
||||
margin-right: 10px;
|
||||
color: var(--color-error-default);
|
||||
}
|
||||
}
|
||||
|
||||
&__account {
|
||||
border-bottom: 1px solid var(--color-border-muted);
|
||||
}
|
||||
|
||||
&__bold {
|
||||
color: var(--color-text-default);
|
||||
}
|
||||
}
|
||||
|
||||
&__footer {
|
||||
border-top: 1px solid var(--color-border-muted);
|
||||
width: 100%;
|
||||
height: 132px;
|
||||
}
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useI18nContext } from '../../../../hooks/useI18nContext';
|
||||
|
||||
import Popover from '../../../ui/popover';
|
||||
import Box from '../../../ui/box';
|
||||
import Button from '../../../ui/button';
|
||||
import Typography from '../../../ui/typography';
|
||||
import {
|
||||
DISPLAY,
|
||||
FLEX_DIRECTION,
|
||||
FONT_WEIGHT,
|
||||
JUSTIFY_CONTENT,
|
||||
TYPOGRAPHY,
|
||||
COLORS,
|
||||
} from '../../../../helpers/constants/design-system';
|
||||
import Identicon from '../../../ui/identicon';
|
||||
import { shortenAddress } from '../../../../helpers/utils/util';
|
||||
|
||||
const SignatureRequestOriginalWarning = ({
|
||||
senderAddress,
|
||||
name,
|
||||
onSubmit,
|
||||
onCancel,
|
||||
}) => {
|
||||
const t = useI18nContext();
|
||||
|
||||
return (
|
||||
<Popover className="signature-request-warning__content">
|
||||
<Box
|
||||
display={DISPLAY.FLEX}
|
||||
flexDirection={FLEX_DIRECTION.ROW}
|
||||
padding={4}
|
||||
className="signature-request-warning__content__header"
|
||||
>
|
||||
<i className="fa fa-exclamation-triangle signature-request-warning__content__header__warning-icon" />
|
||||
<Typography variant={TYPOGRAPHY.H4} fontWeight={FONT_WEIGHT.BOLD}>
|
||||
{t('yourFundsMayBeAtRisk')}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Box
|
||||
display={DISPLAY.FLEX}
|
||||
padding={4}
|
||||
justifyContent={JUSTIFY_CONTENT.SPACE_BETWEEN}
|
||||
className="signature-request-warning__content__account"
|
||||
>
|
||||
<Box display={DISPLAY.FLEX}>
|
||||
<Identicon address={senderAddress} diameter={32} />
|
||||
<Typography
|
||||
variant={TYPOGRAPHY.H5}
|
||||
marginLeft={2}
|
||||
className="signature-request-warning__content__account-name"
|
||||
>
|
||||
<b>{name}</b> {` (${shortenAddress(senderAddress)})`}
|
||||
</Typography>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
<Typography
|
||||
color={COLORS.TEXT_ALTERNATIVE}
|
||||
margin={4}
|
||||
marginTop={4}
|
||||
marginBottom={4}
|
||||
variant={TYPOGRAPHY.H6}
|
||||
>
|
||||
{t('signatureRequestWarning', [
|
||||
<a
|
||||
href="https://consensys.net/blog/metamask/the-seal-of-approval-know-what-youre-consenting-to-with-permissions-and-approvals-in-metamask/"
|
||||
target="_blank"
|
||||
type="link"
|
||||
key="non_custodial_link"
|
||||
rel="noopener noreferrer"
|
||||
style={{ color: 'var(--color-primary-default)' }}
|
||||
>
|
||||
{t('learnMoreUpperCase')}
|
||||
</a>,
|
||||
])}
|
||||
</Typography>
|
||||
|
||||
<Box
|
||||
display={DISPLAY.FLEX}
|
||||
flexDirection={FLEX_DIRECTION.COLUMN}
|
||||
justifyContent={JUSTIFY_CONTENT.SPACE_BETWEEN}
|
||||
padding={4}
|
||||
className="signature-request-warning__footer"
|
||||
>
|
||||
<Button
|
||||
className="signature-request-warning__footer__sign-button"
|
||||
type="danger-primary"
|
||||
onClick={onSubmit}
|
||||
>
|
||||
{t('sign')}
|
||||
</Button>
|
||||
<Button
|
||||
className="signature-request-warning__footer__reject-button"
|
||||
type="secondary"
|
||||
onClick={onCancel}
|
||||
>
|
||||
{t('reject')}
|
||||
</Button>
|
||||
</Box>
|
||||
</Popover>
|
||||
);
|
||||
};
|
||||
|
||||
SignatureRequestOriginalWarning.propTypes = {
|
||||
senderAddress: PropTypes.string,
|
||||
name: PropTypes.string,
|
||||
onSubmit: PropTypes.func,
|
||||
onCancel: PropTypes.func,
|
||||
};
|
||||
|
||||
export default SignatureRequestOriginalWarning;
|
@ -14,6 +14,7 @@ import { stripHexPrefix } from '../../../../shared/modules/hexstring-utils';
|
||||
import Button from '../../ui/button';
|
||||
import SiteIcon from '../../ui/site-icon';
|
||||
import SiteOrigin from '../../ui/site-origin';
|
||||
import SignatureRequestOriginalWarning from './signature-request-original-warning';
|
||||
|
||||
export default class SignatureRequestOriginal extends Component {
|
||||
static contextTypes = {
|
||||
@ -46,6 +47,7 @@ export default class SignatureRequestOriginal extends Component {
|
||||
|
||||
state = {
|
||||
fromAccount: this.props.fromAccount,
|
||||
showSignatureRequestWarning: false,
|
||||
};
|
||||
|
||||
renderHeader = () => {
|
||||
@ -195,7 +197,7 @@ export default class SignatureRequestOriginal extends Component {
|
||||
|
||||
renderBody = () => {
|
||||
let rows;
|
||||
let notice = `${this.context.t('youSign')}:`;
|
||||
const notice = `${this.context.t('youSign')}:`;
|
||||
|
||||
const { txData } = this.props;
|
||||
const {
|
||||
@ -211,32 +213,13 @@ export default class SignatureRequestOriginal extends Component {
|
||||
rows = data;
|
||||
} else if (type === MESSAGE_TYPE.ETH_SIGN) {
|
||||
rows = [{ name: this.context.t('message'), value: data }];
|
||||
notice = this.context.t('signNotice');
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="request-signature__body">
|
||||
{this.renderAccountInfo()}
|
||||
{this.renderOriginInfo()}
|
||||
<div
|
||||
className={classnames('request-signature__notice', {
|
||||
'request-signature__warning': type === MESSAGE_TYPE.ETH_SIGN,
|
||||
})}
|
||||
>
|
||||
{notice}
|
||||
{type === MESSAGE_TYPE.ETH_SIGN ? (
|
||||
<span
|
||||
className="request-signature__help-link"
|
||||
onClick={() => {
|
||||
global.platform.openTab({
|
||||
url: 'https://consensys.net/blog/metamask/the-seal-of-approval-know-what-youre-consenting-to-with-permissions-and-approvals-in-metamask/',
|
||||
});
|
||||
}}
|
||||
>
|
||||
{this.context.t('learnMoreUpperCase')}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
<div className={classnames('request-signature__notice')}>{notice}</div>
|
||||
<div className="request-signature__rows">
|
||||
{rows.map(({ name, value }, index) => {
|
||||
if (typeof value === 'boolean') {
|
||||
@ -258,13 +241,51 @@ export default class SignatureRequestOriginal extends Component {
|
||||
);
|
||||
};
|
||||
|
||||
onSubmit = async (event) => {
|
||||
const { clearConfirmTransaction, history, mostRecentOverviewPage, sign } =
|
||||
this.props;
|
||||
const { trackEvent, type } = this.context;
|
||||
|
||||
await sign(event);
|
||||
trackEvent({
|
||||
category: EVENT.CATEGORIES.TRANSACTIONS,
|
||||
event: 'Confirm',
|
||||
properties: {
|
||||
action: 'Sign Request',
|
||||
legacy_event: true,
|
||||
type,
|
||||
},
|
||||
});
|
||||
clearConfirmTransaction();
|
||||
history.push(mostRecentOverviewPage);
|
||||
};
|
||||
|
||||
onCancel = async (event) => {
|
||||
const { clearConfirmTransaction, history, mostRecentOverviewPage, cancel } =
|
||||
this.props;
|
||||
const { trackEvent, type } = this.context;
|
||||
|
||||
await cancel(event);
|
||||
trackEvent({
|
||||
category: EVENT.CATEGORIES.TRANSACTIONS,
|
||||
event: 'Cancel',
|
||||
properties: {
|
||||
action: 'Sign Request',
|
||||
legacy_event: true,
|
||||
type,
|
||||
},
|
||||
});
|
||||
clearConfirmTransaction();
|
||||
history.push(mostRecentOverviewPage);
|
||||
};
|
||||
|
||||
renderFooter = () => {
|
||||
const {
|
||||
cancel,
|
||||
sign,
|
||||
clearConfirmTransaction,
|
||||
history,
|
||||
mostRecentOverviewPage,
|
||||
sign,
|
||||
txData: { type },
|
||||
hardwareWalletRequiresConnection,
|
||||
} = this.props;
|
||||
@ -300,18 +321,22 @@ export default class SignatureRequestOriginal extends Component {
|
||||
className="request-signature__footer__sign-button"
|
||||
disabled={hardwareWalletRequiresConnection}
|
||||
onClick={async (event) => {
|
||||
await sign(event);
|
||||
trackEvent({
|
||||
category: EVENT.CATEGORIES.TRANSACTIONS,
|
||||
event: 'Confirm',
|
||||
properties: {
|
||||
action: 'Sign Request',
|
||||
legacy_event: true,
|
||||
type,
|
||||
},
|
||||
});
|
||||
clearConfirmTransaction();
|
||||
history.push(mostRecentOverviewPage);
|
||||
if (type === MESSAGE_TYPE.ETH_SIGN) {
|
||||
this.setState({ showSignatureRequestWarning: true });
|
||||
} else {
|
||||
await sign(event);
|
||||
trackEvent({
|
||||
category: EVENT.CATEGORIES.TRANSACTIONS,
|
||||
event: 'Confirm',
|
||||
properties: {
|
||||
action: 'Sign Request',
|
||||
legacy_event: true,
|
||||
type,
|
||||
},
|
||||
});
|
||||
clearConfirmTransaction();
|
||||
history.push(mostRecentOverviewPage);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{t('sign')}
|
||||
@ -343,6 +368,7 @@ export default class SignatureRequestOriginal extends Component {
|
||||
|
||||
render = () => {
|
||||
const { messagesCount } = this.props;
|
||||
const { showSignatureRequestWarning, fromAccount } = this.state;
|
||||
const { t } = this.context;
|
||||
const rejectNText = t('rejectRequestsN', [messagesCount]);
|
||||
return (
|
||||
@ -354,6 +380,14 @@ export default class SignatureRequestOriginal extends Component {
|
||||
<LedgerInstructionField showDataInstruction />
|
||||
</div>
|
||||
) : null}
|
||||
{showSignatureRequestWarning && (
|
||||
<SignatureRequestOriginalWarning
|
||||
senderAddress={fromAccount.address}
|
||||
name={fromAccount.name}
|
||||
onSubmit={async (event) => await this.onSubmit(event)}
|
||||
onCancel={async (event) => await this.onCancel(event)}
|
||||
/>
|
||||
)}
|
||||
{this.renderFooter()}
|
||||
{messagesCount > 1 ? (
|
||||
<Button
|
||||
|
@ -1,8 +1,10 @@
|
||||
import React from 'react';
|
||||
import configureMockStore from 'redux-mock-store';
|
||||
import { fireEvent, screen } from '@testing-library/react';
|
||||
import { MESSAGE_TYPE } from '../../../../shared/constants/app';
|
||||
import mockState from '../../../../test/data/mock-state.json';
|
||||
import { renderWithProvider } from '../../../../test/lib/render-helpers';
|
||||
import configureStore from '../../../store/store';
|
||||
import SignatureRequestOriginal from '.';
|
||||
|
||||
const MOCK_SIGN_DATA = JSON.stringify({
|
||||
@ -37,23 +39,33 @@ const MOCK_SIGN_DATA = JSON.stringify({
|
||||
},
|
||||
});
|
||||
|
||||
const props = {
|
||||
signMessage: jest.fn(),
|
||||
cancelMessage: jest.fn(),
|
||||
txData: {
|
||||
msgParams: {
|
||||
from: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc',
|
||||
data: MOCK_SIGN_DATA,
|
||||
origin: 'https://happydapp.website/governance?futarchy=true',
|
||||
},
|
||||
type: MESSAGE_TYPE.ETH_SIGN,
|
||||
},
|
||||
};
|
||||
|
||||
const render = () => {
|
||||
const store = configureStore({
|
||||
metamask: {
|
||||
...mockState.metamask,
|
||||
},
|
||||
});
|
||||
|
||||
return renderWithProvider(<SignatureRequestOriginal {...props} />, store);
|
||||
};
|
||||
|
||||
describe('SignatureRequestOriginal', () => {
|
||||
const store = configureMockStore()(mockState);
|
||||
|
||||
it('should match snapshot', () => {
|
||||
const props = {
|
||||
signMessage: jest.fn(),
|
||||
cancelMessage: jest.fn(),
|
||||
txData: {
|
||||
msgParams: {
|
||||
from: '0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc',
|
||||
data: MOCK_SIGN_DATA,
|
||||
origin: 'https://happydapp.website/governance?futarchy=true',
|
||||
},
|
||||
type: MESSAGE_TYPE.ETH_SIGN,
|
||||
},
|
||||
};
|
||||
|
||||
const { container } = renderWithProvider(
|
||||
<SignatureRequestOriginal {...props} />,
|
||||
store,
|
||||
@ -61,4 +73,17 @@ describe('SignatureRequestOriginal', () => {
|
||||
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should render eth sign screen', () => {
|
||||
render();
|
||||
expect(screen.getByText('Signature request')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('should render warning for eth sign when sign button clicked', () => {
|
||||
render();
|
||||
const signButton = screen.getByTestId('request-signature__sign');
|
||||
|
||||
fireEvent.click(signButton);
|
||||
expect(screen.getByText('Your funds may be at risk')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user