diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index cf9b663eb..206aa354c 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -138,7 +138,7 @@ jobs: run: | cd tests pip install -r requirements.txt - PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --model=${{ matrix.model }} --timeout=300 + PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --model=${{ matrix.model }} --timeout=500 job_test_mainnet: name: Tests on mainnet diff --git a/src/handler/sign_psbt.c b/src/handler/sign_psbt.c index ce793bc70..e7b79ed0a 100644 --- a/src/handler/sign_psbt.c +++ b/src/handler/sign_psbt.c @@ -1274,7 +1274,7 @@ process_outputs(dispatcher_context_t *dc, sign_psbt_state_t *st) { if (!read_outputs(dc, st, &placeholder_info, true)) return false; - if (!ui_transaction_prompt(dc, st->outputs.n_external)) { + if (!G_swap_state.called_from_swap && !ui_transaction_prompt(dc, st->outputs.n_external)) { SEND_SW(dc, SW_DENY); return false; } @@ -2381,7 +2381,9 @@ sign_transaction(dispatcher_context_t *dc, if (n_key_placeholders < 0) { SEND_SW(dc, SW_BAD_STATE); // should never happen - ui_post_processing_confirm_transaction(dc, false); + if (!G_swap_state.called_from_swap) { + ui_post_processing_confirm_transaction(dc, false); + } return false; } @@ -2415,7 +2417,9 @@ sign_transaction(dispatcher_context_t *dc, &input.in_out.map); if (res < 0) { SEND_SW(dc, SW_INCORRECT_DATA); - ui_post_processing_confirm_transaction(dc, false); + if (!G_swap_state.called_from_swap) { + ui_post_processing_confirm_transaction(dc, false); + } return false; } @@ -2428,7 +2432,9 @@ sign_transaction(dispatcher_context_t *dc, if (!sign_transaction_input(dc, st, &hashes, &placeholder_info, &input, i)) { SEND_SW(dc, SW_BAD_STATE); // should never happen - ui_post_processing_confirm_transaction(dc, false); + if (!G_swap_state.called_from_swap) { + ui_post_processing_confirm_transaction(dc, false); + } return false; } } @@ -2437,7 +2443,9 @@ sign_transaction(dispatcher_context_t *dc, ++placeholder_index; } - ui_post_processing_confirm_transaction(dc, true); + if (!G_swap_state.called_from_swap) { + ui_post_processing_confirm_transaction(dc, true); + } return true; } diff --git a/tests/automations/register_wallet_accept.json b/tests/automations/register_wallet_accept.json index da6346d9a..d96348a90 100644 --- a/tests/automations/register_wallet_accept.json +++ b/tests/automations/register_wallet_accept.json @@ -28,7 +28,7 @@ ] }, { - "regexp": "Processing", + "regexp": "Processing|REGISTERED", "actions": [ ["finger", 55, 550, false] ] diff --git a/tests/automations/sign_with_wallet_external_inputs_accept.json b/tests/automations/sign_with_wallet_external_inputs_accept.json index ec97ec579..8111c7984 100644 --- a/tests/automations/sign_with_wallet_external_inputs_accept.json +++ b/tests/automations/sign_with_wallet_external_inputs_accept.json @@ -8,7 +8,7 @@ ] }, { - "regexp": "[S]?pend from|Wallet name|There are|Reject if you're|Review|Amount|Address|Confirm|Fees", + "regexp": "[S]?pend from|Wallet name|There are|Reject if you['-]re|Review|Amount|Address|Confirm|Fees", "actions": [ ["button", 2, true], ["button", 2, false] diff --git a/tests/test_get_extended_pubkey.py b/tests/test_get_extended_pubkey.py index 7abc12b8b..48b2ba9be 100644 --- a/tests/test_get_extended_pubkey.py +++ b/tests/test_get_extended_pubkey.py @@ -38,7 +38,7 @@ def ux_thread(): def ux_thread_stax(): event = comm.get_next_event() - while "Approve" not in event["text"]: + while "Approve public key" not in event["text"]: if "Tap to continue" in event["text"]: comm.finger_touch(55, 550) @@ -165,7 +165,12 @@ def ux_thread(): comm.press_and_release("right") comm.wait_for_text_event("Confirm public key") comm.press_and_release("right") - comm.wait_for_text_event("111'/222'/333'") + # Temporary fix for broken OCR + if (model == "nanox"): + comm.wait_for_text_event("111-/222-/333-") + else: + comm.wait_for_text_event("111'/222'/333'") + comm.press_and_release("right") comm.wait_for_text_event("not sure") # second line of "Reject if you're not sure" comm.press_and_release("both")