From b8e2709ca8f141a5ded1ffdd5d20d4b388fe49d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ioan=20Biz=C4=83u?= Date: Tue, 11 Feb 2025 15:14:33 +0100 Subject: [PATCH] fix(core): fix br_code inconsistency in sign-tx [no changelog] --- core/src/trezor/ui/layouts/bolt/__init__.py | 4 +--- core/src/trezor/ui/layouts/caesar/__init__.py | 1 + core/src/trezor/ui/layouts/delizia/__init__.py | 2 +- tests/device_tests/ethereum/test_signtx.py | 9 ++------- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/core/src/trezor/ui/layouts/bolt/__init__.py b/core/src/trezor/ui/layouts/bolt/__init__.py index a02bd3b258..f628ed94ab 100644 --- a/core/src/trezor/ui/layouts/bolt/__init__.py +++ b/core/src/trezor/ui/layouts/bolt/__init__.py @@ -864,9 +864,7 @@ if not utils.BITCOIN_ONLY: ) while True: - await with_info( - address_layout, account_info_layout, br_name, ButtonRequestType.Other - ) + await with_info(address_layout, account_info_layout, br_name, br_code) try: await with_info(total_layout, fee_info_layout, br_name, br_code) diff --git a/core/src/trezor/ui/layouts/caesar/__init__.py b/core/src/trezor/ui/layouts/caesar/__init__.py index cb9174893a..e64e6ca635 100644 --- a/core/src/trezor/ui/layouts/caesar/__init__.py +++ b/core/src/trezor/ui/layouts/caesar/__init__.py @@ -982,6 +982,7 @@ if not utils.BITCOIN_ONLY: title, recipient or TR.ethereum__new_contract, verb=TR.buttons__continue, + br_code=br_code, chunkify=(chunkify if recipient else False), ) diff --git a/core/src/trezor/ui/layouts/delizia/__init__.py b/core/src/trezor/ui/layouts/delizia/__init__.py index 3269cff519..48c200caeb 100644 --- a/core/src/trezor/ui/layouts/delizia/__init__.py +++ b/core/src/trezor/ui/layouts/delizia/__init__.py @@ -778,7 +778,7 @@ if not utils.BITCOIN_ONLY: account_path=account_path, address=None, address_title=None, - br_code=ButtonRequestType.Other, + br_code=ButtonRequestType.SignTx, br_name="confirm_output", summary_items=( (TR.words__amount, total_amount), diff --git a/tests/device_tests/ethereum/test_signtx.py b/tests/device_tests/ethereum/test_signtx.py index 4c84843585..17a79bbb54 100644 --- a/tests/device_tests/ethereum/test_signtx.py +++ b/tests/device_tests/ethereum/test_signtx.py @@ -16,7 +16,7 @@ import pytest -from trezorlib import ethereum, exceptions, messages, models +from trezorlib import ethereum, exceptions, messages from trezorlib.debuglink import TrezorClientDebugLink as Client from trezorlib.debuglink import message_filters from trezorlib.exceptions import TrezorFailure @@ -220,15 +220,10 @@ def test_data_streaming(client: Client): checked in vectorized function above. """ with client: - is_t1 = client.model is models.T1B1 client.set_expected_responses( [ messages.ButtonRequest(code=messages.ButtonRequestType.SignTx), - (is_t1, messages.ButtonRequest(code=messages.ButtonRequestType.SignTx)), - ( - not is_t1, - messages.ButtonRequest(code=messages.ButtonRequestType.Other), - ), + messages.ButtonRequest(code=messages.ButtonRequestType.SignTx), messages.ButtonRequest(code=messages.ButtonRequestType.SignTx), message_filters.EthereumTxRequest( data_length=1_024,