From 7f5b045707af6af3824208497efd986fc581fb6c Mon Sep 17 00:00:00 2001 From: fedebuyito <126606287+fedebuyito@users.noreply.github.com> Date: Sun, 23 Feb 2025 00:24:39 +0000 Subject: [PATCH] Update test_flows_seed.py Includes additional failure condition (when QR is recognized but is not a SeedQR) in flow test, directed toward SeedTranscribeSeedQRConfirmInvalidQRView --- tests/test_flows_seed.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_flows_seed.py b/tests/test_flows_seed.py index c1bcc0bb..a9a7f663 100644 --- a/tests/test_flows_seed.py +++ b/tests/test_flows_seed.py @@ -435,6 +435,9 @@ class TestSeedFlows(FlowTest): def load_completely_wrong_qr_type_into_decoder(view: View): view.decoder.add_data("I like cheese") + def load_recognized_qr_type_isnot_seed_into_decoder(view: View): + view.decoder.add_data("UR:CRYPTO-PSBT/HKADHEJOJKIDJYZMADAEGMAOAEAEAEADHHGLEYKGBDSBKEMTSARLVYSGIABEDELFSKWLLUDKLYESJOFDLPJPFXSOHHWZTYWEAEAEAEAEAEZCZMZMZMADBKBZJEDEHEAEAEAECMAEBBVEPFDWDMBBGSPFZTKIMYCLKPSOBDDTRDWTWPYKGAQDKNAEAEGWADAAECLTTKAXWSWTUTSNLAAEAEAEPKCTBSHGISSSRETIVEWSGYNEPTHTESNSWMLBTARYEMHTBTBTLNWSBKJLMKYNFGHLAXJYBBTTIDHKDICHAMLEHHDSRKATGDLYSBIYHNHDNEWPJKZSZMDKVETYNSGOCXKNDNBEOLFSRSNSGHAEAELAADAEAELAAEAEAELAAEADADCTKSBZJEDEHEAEAEAECMAEBBVEPFDWDMBBGSPFZTKIMYCLKPSOBDDTRDWTWPYKGAADAXAAADAEAEAECPAMAODSFTLDTYFRECSKVWYLKNBANNKKZCRTHYJTPSHLHNHKNBPDCLCFDMSOLPDKFXLFQZCSOLFSRSNSGHAEAELAADAEAELAAEAEAELAAEAEAEAEAEAEAEAEAECPAOAODSFTLDTYFRECSKVWYLKNBANNKKZCRTHYJTPSHLHNHKNBPDCLCFDMSOLPDKFXLFQZCSOLFSRSNSGHAEAELAADAEAELAAEAEAELAAEAEAEAEAEAEAEAEAELGMKFZCW") + def load_right_seed_into_decoder(view: View): view.decoder.add_data("0000" * 11 + "0003") @@ -460,6 +463,12 @@ class TestSeedFlows(FlowTest): FlowStep(seed_views.SeedTranscribeSeedQRConfirmInvalidQRView), FlowStep(seed_views.SeedTranscribeSeedQRZoomedInView, is_redirect=True), # Live interactive screens are still weird + # Intentionally scan QR data that makes no sense for this flow because is another QR recognized but is not a SeedQR (e.g., bitcoin address, psbt) + FlowStep(seed_views.SeedTranscribeSeedQRConfirmQRPromptView, button_data_selection=seed_views.SeedTranscribeSeedQRConfirmQRPromptView.SCAN), + FlowStep(seed_views.SeedTranscribeSeedQRConfirmScanView, before_run=load_recognized_qr_type_isnot_seed_into_decoder), + FlowStep(seed_views.SeedTranscribeSeedQRConfirmInvalidQRView), + FlowStep(seed_views.SeedTranscribeSeedQRZoomedInView, is_redirect=True), # Live interactive screens are still weird + # Now scan the correct SeedQR FlowStep(seed_views.SeedTranscribeSeedQRConfirmQRPromptView, button_data_selection=seed_views.SeedTranscribeSeedQRConfirmQRPromptView.SCAN), FlowStep(seed_views.SeedTranscribeSeedQRConfirmScanView, before_run=load_right_seed_into_decoder),