From 0c5836605fd2d4bad5d3c743ad06ed0c6c42e6f0 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Thu, 12 Oct 2023 00:31:02 +0200 Subject: [PATCH] fix(tests): Safe 3 model name [no changelog] --- python/src/trezorlib/debuglink.py | 6 ++-- tests/click_tests/common.py | 4 +-- tests/click_tests/recovery.py | 10 +++--- tests/click_tests/reset.py | 12 +++---- tests/click_tests/test_autolock.py | 22 ++++++------- tests/click_tests/test_lock.py | 4 +-- tests/click_tests/test_pin.py | 18 +++++------ tests/common.py | 2 +- tests/conftest.py | 5 ++- .../bitcoin/test_authorize_coinjoin.py | 4 +-- tests/device_tests/bitcoin/test_bcash.py | 14 ++++---- tests/device_tests/bitcoin/test_bgold.py | 16 +++++----- tests/device_tests/bitcoin/test_dash.py | 4 +-- tests/device_tests/bitcoin/test_decred.py | 8 ++--- tests/device_tests/bitcoin/test_komodo.py | 4 +-- tests/device_tests/bitcoin/test_multisig.py | 2 +- .../bitcoin/test_multisig_change.py | 2 +- tests/device_tests/bitcoin/test_op_return.py | 2 +- tests/device_tests/bitcoin/test_signtx.py | 32 +++++++++---------- .../bitcoin/test_signtx_external.py | 16 +++++----- .../bitcoin/test_signtx_payreq.py | 2 +- .../bitcoin/test_signtx_replacement.py | 4 +-- .../bitcoin/test_signtx_segwit.py | 12 +++---- .../bitcoin/test_signtx_segwit_native.py | 22 ++++++------- .../bitcoin/test_signtx_taproot.py | 12 +++---- tests/device_tests/bitcoin/test_zcash.py | 4 +-- tests/device_tests/cardano/test_sign_tx.py | 2 +- .../device_tests/nem/test_signtx_transfers.py | 4 +-- .../reset_recovery/test_reset_bip39_t2.py | 2 +- tests/device_tests/test_busy_state.py | 2 +- tests/device_tests/test_cancel.py | 2 +- tests/device_tests/test_firmware_hash.py | 2 +- tests/device_tests/test_msg_backup_device.py | 4 +-- tests/device_tests/test_protection_levels.py | 4 +-- .../test_session_id_and_passphrase.py | 2 +- tests/device_tests/zcash/test_sign_tx.py | 14 ++++---- tests/input_flows.py | 10 +++--- tests/input_flows_helpers.py | 22 ++++++------- tests/ui_tests/common.py | 6 +++- 39 files changed, 163 insertions(+), 156 deletions(-) diff --git a/python/src/trezorlib/debuglink.py b/python/src/trezorlib/debuglink.py index b2789f834..67de27da2 100644 --- a/python/src/trezorlib/debuglink.py +++ b/python/src/trezorlib/debuglink.py @@ -452,7 +452,7 @@ class DebugLink: def reset_debug_events(self) -> None: # Only supported on TT and above certain version - if self.model in ("T", "R") and not self.legacy_debug: + if self.model in ("T", "Safe 3") and not self.legacy_debug: return self._call(messages.DebugLinkResetDebugEvents()) return None @@ -703,7 +703,7 @@ class DebugLink: ) -> None: self.screenshot_recording_dir = directory # Different recording logic between core and legacy - if self.model in ("T", "R"): + if self.model in ("T", "Safe 3"): self._call( messages.DebugLinkRecordScreen( target_directory=directory, refresh_index=refresh_index @@ -717,7 +717,7 @@ class DebugLink: def stop_recording(self) -> None: self.screenshot_recording_dir = None # Different recording logic between TT and T1 - if self.model in ("T", "R"): + if self.model in ("T", "Safe 3"): self._call(messages.DebugLinkRecordScreen(target_directory=None)) else: self.t1_take_screenshots = False diff --git a/tests/click_tests/common.py b/tests/click_tests/common.py index 2bbc25918..e6753a669 100644 --- a/tests/click_tests/common.py +++ b/tests/click_tests/common.py @@ -45,7 +45,7 @@ def get_char_category(char: str) -> PassphraseCategory: def go_next(debug: "DebugLink", wait: bool = False) -> "LayoutContent" | None: if debug.model == "T": return debug.click(buttons.OK, wait=wait) # type: ignore - elif debug.model == "R": + elif debug.model == "Safe 3": return debug.press_right(wait=wait) # type: ignore else: raise RuntimeError("Unknown model") @@ -56,7 +56,7 @@ def go_back( ) -> "LayoutContent" | None: if debug.model == "T": return debug.click(buttons.CANCEL, wait=wait) # type: ignore - elif debug.model == "R": + elif debug.model == "Safe 3": if r_middle: return debug.press_middle(wait=wait) # type: ignore else: diff --git a/tests/click_tests/recovery.py b/tests/click_tests/recovery.py index 30fbf17f3..306cc7539 100644 --- a/tests/click_tests/recovery.py +++ b/tests/click_tests/recovery.py @@ -16,7 +16,7 @@ def enter_word( debug.click(coords) return debug.click(buttons.CONFIRM_WORD, wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": letter_index = 0 layout = debug.read_layout() @@ -43,7 +43,7 @@ def confirm_recovery(debug: "DebugLink") -> None: if debug.model == "T": assert layout.title().startswith(("RECOVER WALLET", "BACKUP CHECK")) debug.click(buttons.OK, wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": assert layout.title() == "RECOVER WALLET" debug.press_right(wait=True) debug.press_right() @@ -69,7 +69,7 @@ def select_number_of_words( ) # raises if num of words is invalid coords = buttons.grid34(index % 3, index // 3) layout = debug.click(coords, wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": assert "number of words" in debug.read_layout().text_content() layout = debug.press_right(wait=True) @@ -101,7 +101,7 @@ def enter_share( layout = enter_word(debug, word, is_slip39=True) return layout - elif debug.model == "R": + elif debug.model == "Safe 3": assert "RECOVER WALLET" in debug.wait_layout().title() layout = debug.press_right(wait=True) if is_first: @@ -134,7 +134,7 @@ def enter_seed(debug: "DebugLink", seed_words: list[str]) -> None: if debug.model == "T": layout = debug.click(buttons.OK, wait=True) assert layout.main_component() == "MnemonicKeyboard" - elif debug.model == "R": + elif debug.model == "Safe 3": layout = debug.press_right(wait=True) assert "RECOVER WALLET" in layout.title() debug.press_right() diff --git a/tests/click_tests/reset.py b/tests/click_tests/reset.py index dbdd1b26e..5824cc153 100644 --- a/tests/click_tests/reset.py +++ b/tests/click_tests/reset.py @@ -15,7 +15,7 @@ def confirm_new_wallet(debug: "DebugLink") -> None: assert layout.title().startswith("CREATE WALLET") if debug.model == "T": debug.click(buttons.OK, wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": debug.press_right(wait=True) debug.press_right(wait=True) @@ -43,7 +43,7 @@ def confirm_read(debug: "DebugLink", title: str, middle_r: bool = False) -> None if debug.model == "T": debug.click(buttons.OK, wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": if layout.page_count() > 1: debug.press_right(wait=True) if middle_r: @@ -58,7 +58,7 @@ def set_selection(debug: "DebugLink", button: tuple[int, int], diff: int) -> Non for _ in range(diff): debug.click(button) debug.click(buttons.OK, wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": layout = debug.read_layout() if layout.title() in ("NUMBER OF SHARES", "THRESHOLD"): # Special info screens @@ -86,7 +86,7 @@ def read_words( assert layout.title().startswith("RECOVERY SHARE #") else: assert layout.title() == "RECOVERY SEED" - elif debug.model == "R": + elif debug.model == "Safe 3": if backup_type == messages.BackupType.Slip39_Advanced: assert "SHARE" in layout.title() elif backup_type == messages.BackupType.Slip39_Basic: @@ -109,7 +109,7 @@ def read_words( if do_htc: if debug.model == "T": debug.click_hold(buttons.OK, hold_ms=1500) - elif debug.model == "R": + elif debug.model == "Safe 3": debug.press_right_htc(1200) else: # It would take a very long time to test 16-of-16 with doing 1500 ms HTC after @@ -134,7 +134,7 @@ def confirm_words(debug: "DebugLink", words: list[str]) -> None: wanted_word = words[word_pos - 1].lower() button_pos = btn_texts.index(wanted_word) layout = debug.click(buttons.RESET_WORD_CHECK[button_pos], wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": assert "Select the correct word" in layout.text_content() layout = debug.press_right(wait=True) for _ in range(3): diff --git a/tests/click_tests/test_autolock.py b/tests/click_tests/test_autolock.py index 355462e32..b15503a22 100644 --- a/tests/click_tests/test_autolock.py +++ b/tests/click_tests/test_autolock.py @@ -104,7 +104,7 @@ def test_autolock_interrupts_signing(device_handler: "BackgroundDeviceHandler"): debug.click(buttons.OK, wait=True) layout = debug.click(buttons.OK, wait=True) assert "Total amount: 0.0039 BTC" in layout.text_content() - elif debug.model == "R": + elif debug.model == "Safe 3": debug.press_right(wait=True) layout = debug.press_right(wait=True) assert "Total amount: 0.0039 BTC" in layout.text_content() @@ -149,7 +149,7 @@ def test_autolock_does_not_interrupt_signing(device_handler: "BackgroundDeviceHa debug.click(buttons.OK, wait=True) layout = debug.click(buttons.OK, wait=True) assert "Total amount: 0.0039 BTC" in layout.text_content() - elif debug.model == "R": + elif debug.model == "Safe 3": debug.press_right(wait=True) layout = debug.press_right(wait=True) assert "Total amount: 0.0039 BTC" in layout.text_content() @@ -164,7 +164,7 @@ def test_autolock_does_not_interrupt_signing(device_handler: "BackgroundDeviceHa # confirm transaction if debug.model == "T": debug.click(buttons.OK) - elif debug.model == "R": + elif debug.model == "Safe 3": debug.press_middle() signatures, tx = device_handler.result() @@ -184,7 +184,7 @@ def test_autolock_passphrase_keyboard(device_handler: "BackgroundDeviceHandler") assert "PassphraseKeyboard" in debug.wait_layout().all_components() - if debug.model == "R": + if debug.model == "Safe 3": # Going into the selected character category debug.press_middle() @@ -194,7 +194,7 @@ def test_autolock_passphrase_keyboard(device_handler: "BackgroundDeviceHandler") if debug.model == "T": # click at "j" debug.click(CENTER_BUTTON) - elif debug.model == "R": + elif debug.model == "Safe 3": # just go right # NOTE: because of passphrase randomization it would be a pain to input # a specific passphrase, which is not in scope for this test. @@ -204,7 +204,7 @@ def test_autolock_passphrase_keyboard(device_handler: "BackgroundDeviceHandler") # Send the passphrase to the client (TT has it clicked already, TR needs to input it) if debug.model == "T": debug.click(buttons.OK, wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": debug.input("j" * 8, wait=True) # address corresponding to "jjjjjjjj" passphrase @@ -221,7 +221,7 @@ def test_autolock_interrupts_passphrase(device_handler: "BackgroundDeviceHandler assert "PassphraseKeyboard" in debug.wait_layout().all_components() - if debug.model == "R": + if debug.model == "Safe 3": # Going into the selected character category debug.press_middle() @@ -230,7 +230,7 @@ def test_autolock_interrupts_passphrase(device_handler: "BackgroundDeviceHandler for _ in range(math.ceil(6 / 1.5)): if debug.model == "T": debug.click(CENTER_BUTTON) - elif debug.model == "R": + elif debug.model == "Safe 3": debug.press_middle() time.sleep(1.5) @@ -261,7 +261,7 @@ def test_dryrun_locks_at_number_of_words(device_handler: "BackgroundDeviceHandle layout = unlock_dry_run(debug) assert "number of words" in layout.text_content() - if debug.model == "R": + if debug.model == "Safe 3": debug.press_right(wait=True) # wait for autolock to trigger @@ -297,7 +297,7 @@ def test_dryrun_locks_at_word_entry(device_handler: "BackgroundDeviceHandler"): if debug.model == "T": layout = debug.click(buttons.OK, wait=True) assert layout.main_component() == "MnemonicKeyboard" - elif debug.model == "R": + elif debug.model == "Safe 3": layout = debug.press_right(wait=True) assert "MnemonicKeyboard" in layout.all_components() @@ -331,7 +331,7 @@ def test_dryrun_enter_word_slowly(device_handler: "BackgroundDeviceHandler"): layout = debug.click(buttons.CONFIRM_WORD, wait=True) # should not have locked, even though we took 9 seconds to type each letter assert layout.main_component() == "MnemonicKeyboard" - elif debug.model == "R": + elif debug.model == "Safe 3": layout = debug.press_right(wait=True) assert "MnemonicKeyboard" in layout.all_components() diff --git a/tests/click_tests/test_lock.py b/tests/click_tests/test_lock.py index d0bc431a8..199631021 100644 --- a/tests/click_tests/test_lock.py +++ b/tests/click_tests/test_lock.py @@ -36,7 +36,7 @@ def test_hold_to_lock(device_handler: "BackgroundDeviceHandler"): lock_duration = 3500 if debug.model == "T" else 1200 def hold(duration: int, wait: bool = True) -> None: - if debug.model == "R": + if debug.model == "Safe 3": debug.press_right_htc(hold_ms=duration) else: debug.input(x=13, y=37, hold_ms=duration, wait=wait) @@ -63,7 +63,7 @@ def test_hold_to_lock(device_handler: "BackgroundDeviceHandler"): assert device_handler.features().unlocked is False # unlock by touching - if debug.model == "R": + if debug.model == "Safe 3": # Doing a short HTC to simulate a click debug.press_right_htc(hold_ms=100) layout = debug.wait_layout() diff --git a/tests/click_tests/test_pin.py b/tests/click_tests/test_pin.py index 3c34ad181..50e4e5921 100644 --- a/tests/click_tests/test_pin.py +++ b/tests/click_tests/test_pin.py @@ -87,7 +87,7 @@ def prepare( assert "Turn on" in debug.wait_layout().text_content() if debug.model == "T": go_next(debug) - elif debug.model == "R": + elif debug.model == "Safe 3": go_next(debug, wait=True) go_next(debug, wait=True) go_next(debug, wait=True) @@ -106,7 +106,7 @@ def prepare( _input_see_confirm(debug, old_pin) assert "Turn on" in debug.wait_layout().text_content() go_next(debug, wait=True) - if debug.model == "R": + if debug.model == "Safe 3": go_next(debug, wait=True) go_next(debug, wait=True) go_next(debug, wait=True) @@ -136,7 +136,7 @@ def _input_pin(debug: "DebugLink", pin: str, check: bool = False) -> None: digit_index = digits_order.index(digit) coords = buttons.pin_passphrase_index(digit_index) debug.click(coords, wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": for digit in pin: navigate_to_action_and_press(debug, digit, TR_PIN_ACTIONS) @@ -149,7 +149,7 @@ def _see_pin(debug: "DebugLink") -> None: """Navigate to "SHOW" and press it""" if debug.model == "T": debug.click(buttons.TOP_ROW, wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": navigate_to_action_and_press(debug, "SHOW", TR_PIN_ACTIONS) @@ -161,7 +161,7 @@ def _delete_pin(debug: "DebugLink", digits_to_delete: int, check: bool = True) - for _ in range(digits_to_delete): if debug.model == "T": debug.click(buttons.pin_passphrase_grid(9), wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": navigate_to_action_and_press(debug, "DELETE", TR_PIN_ACTIONS) if check: @@ -173,7 +173,7 @@ def _delete_all(debug: "DebugLink", check: bool = True) -> None: """Navigate to "DELETE" and hold it until all digits are deleted""" if debug.model == "T": debug.click_hold(buttons.pin_passphrase_grid(9), hold_ms=1500) - elif debug.model == "R": + elif debug.model == "Safe 3": navigate_to_action_and_press(debug, "DELETE", TR_PIN_ACTIONS, hold_ms=1000) if check: @@ -192,7 +192,7 @@ def _confirm_pin(debug: "DebugLink") -> None: """Navigate to "ENTER" and press it""" if debug.model == "T": debug.click(buttons.pin_passphrase_grid(11), wait=True) - elif debug.model == "R": + elif debug.model == "Safe 3": navigate_to_action_and_press(debug, "ENTER", TR_PIN_ACTIONS) @@ -205,7 +205,7 @@ def _input_see_confirm(debug: "DebugLink", pin: str) -> None: def _enter_two_times(debug: "DebugLink", pin1: str, pin2: str) -> None: _input_see_confirm(debug, pin1) - if debug.model == "R": + if debug.model == "Safe 3": # Please re-enter go_next(debug, wait=True) @@ -298,7 +298,7 @@ def test_pin_setup_mismatch(device_handler: "BackgroundDeviceHandler"): if debug.model == "T": go_next(debug) _cancel_pin(debug) - elif debug.model == "R": + elif debug.model == "Safe 3": debug.press_middle() debug.press_no() diff --git a/tests/common.py b/tests/common.py index 4379aad56..d6f601935 100644 --- a/tests/common.py +++ b/tests/common.py @@ -162,7 +162,7 @@ def read_and_confirm_mnemonic( # TODO: these are very similar, reuse some code if debug.model == "T": mnemonic = yield from read_and_confirm_mnemonic_tt(debug, choose_wrong) - elif debug.model == "R": + elif debug.model == "Safe 3": mnemonic = yield from read_and_confirm_mnemonic_tr(debug, choose_wrong) else: raise ValueError(f"Unknown model: {debug.model}") diff --git a/tests/conftest.py b/tests/conftest.py index 378195ec0..432cd22fe 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -192,7 +192,10 @@ def client( pytest.skip("Test excluded on Trezor T") if request.node.get_closest_marker("skip_t1") and _raw_client.features.model == "1": pytest.skip("Test excluded on Trezor 1") - if request.node.get_closest_marker("skip_tr") and _raw_client.features.model == "R": + if ( + request.node.get_closest_marker("skip_tr") + and _raw_client.features.model == "Safe 3" + ): pytest.skip("Test excluded on Trezor R") sd_marker = request.node.get_closest_marker("sd_card") diff --git a/tests/device_tests/bitcoin/test_authorize_coinjoin.py b/tests/device_tests/bitcoin/test_authorize_coinjoin.py index e1cff4ec1..9b4cc5cbd 100644 --- a/tests/device_tests/bitcoin/test_authorize_coinjoin.py +++ b/tests/device_tests/bitcoin/test_authorize_coinjoin.py @@ -453,7 +453,7 @@ def test_sign_tx_spend(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ messages.ButtonRequest(code=B.Other), @@ -528,7 +528,7 @@ def test_sign_tx_migration(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ messages.ButtonRequest(code=B.Other), diff --git a/tests/device_tests/bitcoin/test_bcash.py b/tests/device_tests/bitcoin/test_bcash.py index 7f1fe78b5..ae4962ea3 100644 --- a/tests/device_tests/bitcoin/test_bcash.py +++ b/tests/device_tests/bitcoin/test_bcash.py @@ -72,7 +72,7 @@ def test_send_bch_change(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -125,7 +125,7 @@ def test_send_bch_nochange(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -184,7 +184,7 @@ def test_send_bch_oldaddr(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -255,7 +255,7 @@ def test_attack_change_input(client: Client): return msg with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_filter(messages.TxAck, attack_processor) client.set_expected_responses( [ @@ -331,7 +331,7 @@ def test_send_bch_multisig_wrongchange(client: Client): amount=23_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -400,7 +400,7 @@ def test_send_bch_multisig_change(client: Client): amount=24_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -502,7 +502,7 @@ def test_send_bch_external_presigned(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), diff --git a/tests/device_tests/bitcoin/test_bgold.py b/tests/device_tests/bitcoin/test_bgold.py index 10bb18bb8..f500b8c67 100644 --- a/tests/device_tests/bitcoin/test_bgold.py +++ b/tests/device_tests/bitcoin/test_bgold.py @@ -71,7 +71,7 @@ def test_send_bitcoin_gold_change(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -125,7 +125,7 @@ def test_send_bitcoin_gold_nochange(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -195,7 +195,7 @@ def test_attack_change_input(client: Client): return msg with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_filter(messages.TxAck, attack_processor) client.set_expected_responses( [ @@ -257,7 +257,7 @@ def test_send_btg_multisig_change(client: Client): amount=1_252_382_934 - 24_000 - 1_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -351,7 +351,7 @@ def test_send_p2sh(client: Client): amount=1_252_382_934 - 11_000 - 12_300_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -405,7 +405,7 @@ def test_send_p2sh_witness_change(client: Client): amount=1_252_382_934 - 11_000 - 12_300_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -466,7 +466,7 @@ def test_send_multisig_1(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -584,7 +584,7 @@ def test_send_btg_external_presigned(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), diff --git a/tests/device_tests/bitcoin/test_dash.py b/tests/device_tests/bitcoin/test_dash.py index 1f6441d19..45f3e8a34 100644 --- a/tests/device_tests/bitcoin/test_dash.py +++ b/tests/device_tests/bitcoin/test_dash.py @@ -57,7 +57,7 @@ def test_send_dash(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -105,7 +105,7 @@ def test_send_dash_dip2_input(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), diff --git a/tests/device_tests/bitcoin/test_decred.py b/tests/device_tests/bitcoin/test_decred.py index b762498db..d67e9c348 100644 --- a/tests/device_tests/bitcoin/test_decred.py +++ b/tests/device_tests/bitcoin/test_decred.py @@ -72,7 +72,7 @@ def test_send_decred(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -194,7 +194,7 @@ def test_spend_from_stake_generation_and_revocation_decred(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -276,7 +276,7 @@ def test_send_decred_change(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -383,7 +383,7 @@ def test_decred_multisig_change(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), diff --git a/tests/device_tests/bitcoin/test_komodo.py b/tests/device_tests/bitcoin/test_komodo.py index dccfea95a..a26b3d23a 100644 --- a/tests/device_tests/bitcoin/test_komodo.py +++ b/tests/device_tests/bitcoin/test_komodo.py @@ -61,7 +61,7 @@ def test_one_one_fee_sapling(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -126,7 +126,7 @@ def test_one_one_rewards_claim(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), diff --git a/tests/device_tests/bitcoin/test_multisig.py b/tests/device_tests/bitcoin/test_multisig.py index abfe61641..b7693be1b 100644 --- a/tests/device_tests/bitcoin/test_multisig.py +++ b/tests/device_tests/bitcoin/test_multisig.py @@ -83,7 +83,7 @@ def test_2_of_3(client: Client, chunkify: bool): ) # Expected responses are the same for both two signings - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") expected_responses = [ request_input(0), request_output(0), diff --git a/tests/device_tests/bitcoin/test_multisig_change.py b/tests/device_tests/bitcoin/test_multisig_change.py index 6e155babb..4d3f1e49d 100644 --- a/tests/device_tests/bitcoin/test_multisig_change.py +++ b/tests/device_tests/bitcoin/test_multisig_change.py @@ -145,7 +145,7 @@ def _responses( change: int = 0, foreign: bool = False, ): - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") resp = [ request_input(0), request_input(1), diff --git a/tests/device_tests/bitcoin/test_op_return.py b/tests/device_tests/bitcoin/test_op_return.py index f7410680b..19ebefef2 100644 --- a/tests/device_tests/bitcoin/test_op_return.py +++ b/tests/device_tests/bitcoin/test_op_return.py @@ -63,7 +63,7 @@ def test_opreturn(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), diff --git a/tests/device_tests/bitcoin/test_signtx.py b/tests/device_tests/bitcoin/test_signtx.py index 42a2ac77c..3bad0cc92 100644 --- a/tests/device_tests/bitcoin/test_signtx.py +++ b/tests/device_tests/bitcoin/test_signtx.py @@ -127,7 +127,7 @@ def test_one_one_fee(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -181,7 +181,7 @@ def test_testnet_one_two_fee(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -232,7 +232,7 @@ def test_testnet_fee_high_warning(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -285,7 +285,7 @@ def test_one_two_fee(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -348,7 +348,7 @@ def test_one_three_fee(client: Client, chunkify: bool): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -420,7 +420,7 @@ def test_two_two(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -565,7 +565,7 @@ def test_lots_of_change(client: Client): request_change_outputs = [request_output(i + 1) for i in range(cnt)] with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -617,7 +617,7 @@ def test_fee_high_warning(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -706,7 +706,7 @@ def test_not_enough_funds(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -737,7 +737,7 @@ def test_p2sh(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -825,7 +825,7 @@ def test_attack_change_outputs(client: Client): # Test if the transaction can be signed normally with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -993,7 +993,7 @@ def test_attack_change_input_address(client: Client): # Now run the attack, must trigger the exception with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_filter(messages.TxAck, attack_processor) client.set_expected_responses( [ @@ -1045,7 +1045,7 @@ def test_spend_coinbase(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -1104,7 +1104,7 @@ def test_two_changes(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -1164,7 +1164,7 @@ def test_change_on_main_chain_allowed(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -1429,7 +1429,7 @@ def test_lock_time(client: Client, lock_time: int, sequence: int): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), diff --git a/tests/device_tests/bitcoin/test_signtx_external.py b/tests/device_tests/bitcoin/test_signtx_external.py index 15702acd4..76ef1beaf 100644 --- a/tests/device_tests/bitcoin/test_signtx_external.py +++ b/tests/device_tests/bitcoin/test_signtx_external.py @@ -216,7 +216,7 @@ def test_p2wpkh_in_p2sh_presigned(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -268,7 +268,7 @@ def test_p2wpkh_in_p2sh_presigned(client: Client): # Test corrupted script hash in scriptsig. inp1.script_sig[10] ^= 1 with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -401,7 +401,7 @@ def test_p2wsh_external_presigned(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -447,7 +447,7 @@ def test_p2wsh_external_presigned(client: Client): # Test corrupted signature in witness. inp2.witness[10] ^= 1 with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -513,7 +513,7 @@ def test_p2tr_external_presigned(client: Client): script_type=messages.OutputScriptType.PAYTOTAPROOT, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -546,7 +546,7 @@ def test_p2tr_external_presigned(client: Client): # Test corrupted signature in witness. inp2.witness[10] ^= 1 with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -617,7 +617,7 @@ def test_p2wpkh_with_proof(client: Client): with client: is_t1 = client.features.model == "1" - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -711,7 +711,7 @@ def test_p2tr_with_proof(client: Client): with client: is_t1 = client.features.model == "1" - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), diff --git a/tests/device_tests/bitcoin/test_signtx_payreq.py b/tests/device_tests/bitcoin/test_signtx_payreq.py index 9b590931c..7ab410f6b 100644 --- a/tests/device_tests/bitcoin/test_signtx_payreq.py +++ b/tests/device_tests/bitcoin/test_signtx_payreq.py @@ -184,7 +184,7 @@ def test_payment_request(client: Client, payment_request_params): def test_payment_request_details(client: Client): - if client.features.model == "R": + if client.features.model == "Safe 3": pytest.skip("Details not implemented on TR") # Test that payment request details are shown when requested. diff --git a/tests/device_tests/bitcoin/test_signtx_replacement.py b/tests/device_tests/bitcoin/test_signtx_replacement.py index ab4292527..eb912535f 100644 --- a/tests/device_tests/bitcoin/test_signtx_replacement.py +++ b/tests/device_tests/bitcoin/test_signtx_replacement.py @@ -115,7 +115,7 @@ def test_p2pkh_fee_bump(client: Client): orig_index=1, ) - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") with client: client.set_expected_responses( @@ -600,7 +600,7 @@ def test_p2wpkh_in_p2sh_fee_bump_from_external(client: Client): orig_index=0, ) - is_tr = client.features.model == "R" + is_tr = client.features.model == "Safe 3" with client: client.set_expected_responses( [ diff --git a/tests/device_tests/bitcoin/test_signtx_segwit.py b/tests/device_tests/bitcoin/test_signtx_segwit.py index 2c9862678..65f7709a3 100644 --- a/tests/device_tests/bitcoin/test_signtx_segwit.py +++ b/tests/device_tests/bitcoin/test_signtx_segwit.py @@ -66,7 +66,7 @@ def test_send_p2sh(client: Client, chunkify: bool): amount=123_456_789 - 11_000 - 12_300_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -125,7 +125,7 @@ def test_send_p2sh_change(client: Client): amount=123_456_789 - 11_000 - 12_300_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -181,7 +181,7 @@ def test_testnet_segwit_big_amount(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -239,7 +239,7 @@ def test_send_multisig_1(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") expected_responses = [ request_input(0), request_output(0), @@ -307,7 +307,7 @@ def test_attack_change_input_address(client: Client): # Test if the transaction can be signed normally. with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -387,7 +387,7 @@ def test_attack_mixed_inputs(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") expected_responses = [ request_input(0), request_input(1), diff --git a/tests/device_tests/bitcoin/test_signtx_segwit_native.py b/tests/device_tests/bitcoin/test_signtx_segwit_native.py index f2ad71b21..3360999d0 100644 --- a/tests/device_tests/bitcoin/test_signtx_segwit_native.py +++ b/tests/device_tests/bitcoin/test_signtx_segwit_native.py @@ -81,7 +81,7 @@ def test_send_p2sh(client: Client): amount=123_456_789 - 11_000 - 12_300_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -137,7 +137,7 @@ def test_send_p2sh_change(client: Client): amount=123_456_789 - 11_000 - 12_300_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -191,7 +191,7 @@ def test_send_native(client: Client): amount=100_000 - 40_000 - 10_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -279,7 +279,7 @@ def test_send_native_change(client: Client): amount=100_000 - 40_000 - 10_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -347,8 +347,8 @@ def test_send_both(client: Client): ) with client: - is_core = client.features.model in ("T", "R") - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -433,7 +433,7 @@ def test_send_multisig_1(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") expected_responses = [ request_input(0), request_output(0), @@ -511,7 +511,7 @@ def test_send_multisig_2(client: Client): script_type=messages.OutputScriptType.PAYTOADDRESS, ) - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") expected_responses = [ request_input(0), request_output(0), @@ -596,7 +596,7 @@ def test_send_multisig_3_change(client: Client): script_type=messages.OutputScriptType.PAYTOP2SHWITNESS, ) - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") expected_responses = [ request_input(0), request_output(0), @@ -683,7 +683,7 @@ def test_send_multisig_4_change(client: Client): script_type=messages.OutputScriptType.PAYTOWITNESS, ) - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") expected_responses = [ request_input(0), request_output(0), @@ -785,7 +785,7 @@ def test_multisig_mismatch_inputs_single(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), diff --git a/tests/device_tests/bitcoin/test_signtx_taproot.py b/tests/device_tests/bitcoin/test_signtx_taproot.py index af7cf0282..cd2bbcb8a 100644 --- a/tests/device_tests/bitcoin/test_signtx_taproot.py +++ b/tests/device_tests/bitcoin/test_signtx_taproot.py @@ -79,7 +79,7 @@ def test_send_p2tr(client: Client, chunkify: bool): script_type=messages.OutputScriptType.PAYTOADDRESS, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -134,7 +134,7 @@ def test_send_two_with_change(client: Client): amount=6_800 + 13_000 - 200 - 15_000, ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -224,8 +224,8 @@ def test_send_mixed(client: Client): ) with client: - is_core = client.features.model in ("T", "R") - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ # process inputs @@ -358,8 +358,8 @@ def test_attack_script_type(client: Client): return msg with client: - is_core = client.features.model in ("T", "R") - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") + is_core = client.features.model in ("T", "Safe 3") client.set_filter(messages.TxAck, attack_processor) client.set_expected_responses( [ diff --git a/tests/device_tests/bitcoin/test_zcash.py b/tests/device_tests/bitcoin/test_zcash.py index 256a6ed02..36f372989 100644 --- a/tests/device_tests/bitcoin/test_zcash.py +++ b/tests/device_tests/bitcoin/test_zcash.py @@ -106,7 +106,7 @@ def test_one_one_fee_sapling(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -260,7 +260,7 @@ def test_external_presigned(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), diff --git a/tests/device_tests/cardano/test_sign_tx.py b/tests/device_tests/cardano/test_sign_tx.py index bbb41e495..2b79e5d23 100644 --- a/tests/device_tests/cardano/test_sign_tx.py +++ b/tests/device_tests/cardano/test_sign_tx.py @@ -36,7 +36,7 @@ def show_details_input_flow(client: Client): if client.features.model == "T": SHOW_ALL_BUTTON_POSITION = (143, 167) client.debug.click(SHOW_ALL_BUTTON_POSITION) - elif client.features.model == "R": + elif client.features.model == "Safe 3": client.debug.press_yes() # reset ui flow to continue "automatically" client.ui.input_flow = None diff --git a/tests/device_tests/nem/test_signtx_transfers.py b/tests/device_tests/nem/test_signtx_transfers.py index 40491669a..5aca8726b 100644 --- a/tests/device_tests/nem/test_signtx_transfers.py +++ b/tests/device_tests/nem/test_signtx_transfers.py @@ -33,7 +33,7 @@ pytestmark = [ # assertion data from T1 @pytest.mark.parametrize("chunkify", (True, False)) def test_nem_signtx_simple(client: Client, chunkify: bool): - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") with client: client.set_expected_responses( [ @@ -85,7 +85,7 @@ def test_nem_signtx_simple(client: Client, chunkify: bool): @pytest.mark.setup_client(mnemonic=MNEMONIC12) def test_nem_signtx_encrypted_payload(client: Client): with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ # Confirm transfer and network fee diff --git a/tests/device_tests/reset_recovery/test_reset_bip39_t2.py b/tests/device_tests/reset_recovery/test_reset_bip39_t2.py index aacbb75ba..1e3fe2091 100644 --- a/tests/device_tests/reset_recovery/test_reset_bip39_t2.py +++ b/tests/device_tests/reset_recovery/test_reset_bip39_t2.py @@ -167,7 +167,7 @@ def test_failed_pin(client: Client): ret = client.call_raw(messages.ButtonAck()) # Re-enter PIN for TR - if client.debug.model == "R": + if client.debug.model == "Safe 3": assert isinstance(ret, messages.ButtonRequest) client.debug.press_yes() ret = client.call_raw(messages.ButtonAck()) diff --git a/tests/device_tests/test_busy_state.py b/tests/device_tests/test_busy_state.py index 185599d43..c81ac9843 100644 --- a/tests/device_tests/test_busy_state.py +++ b/tests/device_tests/test_busy_state.py @@ -27,7 +27,7 @@ PIN = "1234" def _assert_busy(client: Client, should_be_busy: bool, screen: str = "Homescreen"): assert client.features.busy is should_be_busy - if client.debug.model in ("T", "R"): + if client.debug.model in ("T", "Safe 3"): if should_be_busy: assert "CoinJoinProgress" in client.debug.read_layout().all_components() else: diff --git a/tests/device_tests/test_cancel.py b/tests/device_tests/test_cancel.py index ebf73ccc1..ff831bfdc 100644 --- a/tests/device_tests/test_cancel.py +++ b/tests/device_tests/test_cancel.py @@ -93,7 +93,7 @@ def test_cancel_on_paginated(client: Client): # In TR, confirm message is no longer paginated by default, # user needs to click info button - if client.debug.model == "R": + if client.debug.model == "Safe 3": client._raw_write(m.ButtonAck()) client.debug.press_right() resp = client._raw_read() diff --git a/tests/device_tests/test_firmware_hash.py b/tests/device_tests/test_firmware_hash.py index ef5986899..ea6e32336 100644 --- a/tests/device_tests/test_firmware_hash.py +++ b/tests/device_tests/test_firmware_hash.py @@ -8,7 +8,7 @@ from trezorlib.debuglink import TrezorClientDebugLink as Client FIRMWARE_LENGTHS = { "1": 7 * 128 * 1024 + 64 * 1024, "T": 13 * 128 * 1024, - "R": 13 * 128 * 1024, + "Safe 3": 13 * 128 * 1024, } diff --git a/tests/device_tests/test_msg_backup_device.py b/tests/device_tests/test_msg_backup_device.py index 8f0d1fb9c..8a5903768 100644 --- a/tests/device_tests/test_msg_backup_device.py +++ b/tests/device_tests/test_msg_backup_device.py @@ -59,7 +59,7 @@ def test_backup_bip39(client: Client): "click_info", [True, False], ids=["click_info", "no_click_info"] ) def test_backup_slip39_basic(client: Client, click_info: bool): - if click_info and client.features.model == "R": + if click_info and client.features.model == "Safe 3": pytest.skip("click_info not implemented on TR") assert client.features.needs_backup is True @@ -87,7 +87,7 @@ def test_backup_slip39_basic(client: Client, click_info: bool): "click_info", [True, False], ids=["click_info", "no_click_info"] ) def test_backup_slip39_advanced(client: Client, click_info: bool): - if click_info and client.features.model == "R": + if click_info and client.features.model == "Safe 3": pytest.skip("click_info not implemented on TR") assert client.features.needs_backup is True diff --git a/tests/device_tests/test_protection_levels.py b/tests/device_tests/test_protection_levels.py index b919e7d2b..530716da2 100644 --- a/tests/device_tests/test_protection_levels.py +++ b/tests/device_tests/test_protection_levels.py @@ -140,7 +140,7 @@ def test_change_pin_t2(client: Client): messages.ButtonRequest, _pin_request(client), _pin_request(client), - (client.debug.model == "R", messages.ButtonRequest), + (client.debug.model == "Safe 3", messages.ButtonRequest), _pin_request(client), messages.ButtonRequest, messages.Success, @@ -362,7 +362,7 @@ def test_signtx(client: Client): _assert_protection(client) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.use_pin_sequence([PIN4]) client.set_expected_responses( [ diff --git a/tests/device_tests/test_session_id_and_passphrase.py b/tests/device_tests/test_session_id_and_passphrase.py index 332f71d65..2bb9677e5 100644 --- a/tests/device_tests/test_session_id_and_passphrase.py +++ b/tests/device_tests/test_session_id_and_passphrase.py @@ -402,7 +402,7 @@ def test_hide_passphrase_from_host(client: Client): in layout.text_content() ) client.debug.press_yes() - elif client.debug.model == "R": + elif client.debug.model == "Safe 3": layout = client.debug.wait_layout() assert "will not be displayed" in layout.text_content() client.debug.press_right() diff --git a/tests/device_tests/zcash/test_sign_tx.py b/tests/device_tests/zcash/test_sign_tx.py index 388c8040e..7e361c368 100644 --- a/tests/device_tests/zcash/test_sign_tx.py +++ b/tests/device_tests/zcash/test_sign_tx.py @@ -95,7 +95,7 @@ def test_spend_v4_input(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -144,7 +144,7 @@ def test_send_to_multisig(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -192,7 +192,7 @@ def test_spend_v5_input(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -246,7 +246,7 @@ def test_one_two(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -305,7 +305,7 @@ def test_unified_address(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -370,7 +370,7 @@ def test_external_presigned(client: Client): ) with client: - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") client.set_expected_responses( [ request_input(0), @@ -483,7 +483,7 @@ def test_spend_multisig(client: Client): ) # Expected responses are the same for both two signings - is_core = client.features.model in ("T", "R") + is_core = client.features.model in ("T", "Safe 3") expected_responses = [ request_input(0), request_output(0), diff --git a/tests/input_flows.py b/tests/input_flows.py index 90e1f7a78..6f52592c6 100644 --- a/tests/input_flows.py +++ b/tests/input_flows.py @@ -61,7 +61,7 @@ class InputFlowBase: return getattr(self, "input_flow_common") elif self.model() == "T": return self.input_flow_tt - elif self.model() == "R": + elif self.model() == "Safe 3": return self.input_flow_tr else: raise ValueError("Unknown model") @@ -97,7 +97,7 @@ class InputFlowSetupDevicePINWIpeCode(InputFlowBase): yield # do you want to set/change the wipe code? self.debug.press_yes() - if self.debug.model == "R": + if self.debug.model == "Safe 3": yield from swipe_if_necessary(self.debug) # wipe code info self.debug.press_yes() @@ -126,7 +126,7 @@ class InputFlowNewCodeMismatch(InputFlowBase): yield # do you want to set/change the pin/wipe code? self.debug.press_yes() - if self.debug.model == "R": + if self.debug.model == "Safe 3": yield from swipe_if_necessary(self.debug) # code info self.debug.press_yes() @@ -751,7 +751,7 @@ class InputFlowEIP712ShowMore(InputFlowBase): """Model-specific, either clicks a screen or presses a button.""" if self.model() == "T": self.debug.click(self.SHOW_MORE) - elif self.model() == "R": + elif self.model() == "Safe 3": self.debug.press_right() def input_flow_common(self) -> BRGeneratorType: @@ -1565,7 +1565,7 @@ class InputFlowResetSkipBackup(InputFlowBase): yield from self.BAK.confirm_new_wallet() yield # Skip Backup assert "New wallet created" in self.text_content() - if self.debug.model == "R": + if self.debug.model == "Safe 3": self.debug.press_right() self.debug.press_no() yield # Confirm skip backup diff --git a/tests/input_flows_helpers.py b/tests/input_flows_helpers.py index 4e189ac95..64aefaa73 100644 --- a/tests/input_flows_helpers.py +++ b/tests/input_flows_helpers.py @@ -17,7 +17,7 @@ class PinFlow: yield # Enter PIN assert "PinKeyboard" in self.debug.wait_layout().all_components() self.debug.input(pin) - if self.debug.model == "R": + if self.debug.model == "Safe 3": yield # Reenter PIN assert "re-enter PIN" in self.debug.wait_layout().text_content() self.debug.press_yes() @@ -37,7 +37,7 @@ class BackupFlow: def confirm_new_wallet(self) -> BRGeneratorType: yield assert "By continuing you agree" in self.debug.wait_layout().text_content() - if self.debug.model == "R": + if self.debug.model == "Safe 3": self.debug.press_right() self.debug.press_yes() @@ -50,7 +50,7 @@ class RecoveryFlow: def confirm_recovery(self) -> BRGeneratorType: yield assert "By continuing you agree" in self.debug.wait_layout().text_content() - if self.debug.model == "R": + if self.debug.model == "Safe 3": self.debug.press_right() self.debug.press_yes() @@ -60,13 +60,13 @@ class RecoveryFlow: self.debug.press_yes() def setup_slip39_recovery(self, num_words: int) -> BRGeneratorType: - if self.debug.model == "R": + if self.debug.model == "Safe 3": yield from self.tr_recovery_homescreen() yield from self.input_number_of_words(num_words) yield from self.enter_any_share() def setup_bip39_recovery(self, num_words: int) -> BRGeneratorType: - if self.debug.model == "R": + if self.debug.model == "Safe 3": yield from self.tr_recovery_homescreen() yield from self.input_number_of_words(num_words) yield from self.enter_your_backup() @@ -80,7 +80,7 @@ class RecoveryFlow: yield assert "Enter your backup" in self.debug.wait_layout().text_content() if ( - self.debug.model == "R" + self.debug.model == "Safe 3" and "BACKUP CHECK" not in self.debug.wait_layout().title() ): # Normal recovery has extra info (not dry run) @@ -92,7 +92,7 @@ class RecoveryFlow: yield assert "Enter any share" in self.debug.wait_layout().text_content() if ( - self.debug.model == "R" + self.debug.model == "Safe 3" and "BACKUP CHECK" not in self.debug.wait_layout().title() ): # Normal recovery has extra info (not dry run) @@ -102,7 +102,7 @@ class RecoveryFlow: def abort_recovery(self, confirm: bool) -> BRGeneratorType: yield - if self.debug.model == "R": + if self.debug.model == "Safe 3": assert "number of words" in self.debug.wait_layout().text_content() else: assert "Enter any share" in self.debug.wait_layout().text_content() @@ -110,7 +110,7 @@ class RecoveryFlow: yield assert "cancel the recovery" in self.debug.wait_layout().text_content() - if self.debug.model == "R": + if self.debug.model == "Safe 3": self.debug.press_right() if confirm: self.debug.press_yes() @@ -120,7 +120,7 @@ class RecoveryFlow: def input_number_of_words(self, num_words: int) -> BRGeneratorType: br = yield assert br.code == B.MnemonicWordCount - if self.debug.model == "R": + if self.debug.model == "Safe 3": assert "NUMBER OF WORDS" in self.debug.wait_layout().title() else: assert "number of words" in self.debug.wait_layout().text_content() @@ -214,7 +214,7 @@ class RecoveryFlow: assert br.code == B.MnemonicInput assert "MnemonicKeyboard" in self.debug.wait_layout().all_components() for index, word in enumerate(mnemonic): - if self.debug.model == "R": + if self.debug.model == "Safe 3": assert f"WORD {index + 1}" in self.debug.wait_layout().title() else: assert ( diff --git a/tests/ui_tests/common.py b/tests/ui_tests/common.py index ef460a9ce..f71dfc0dd 100644 --- a/tests/ui_tests/common.py +++ b/tests/ui_tests/common.py @@ -223,9 +223,13 @@ class TestCase: @classmethod def build(cls, client: Client, request: pytest.FixtureRequest) -> Self: + model = client.features.model + # FIXME + if model == "Safe 3": + model = "R" name, group = _get_test_name_and_group(request.node.nodeid) return cls( - model=f"T{client.features.model}", + model=f"T{model}", name=name, group=group, )