From 5a684cd5e3b81c86a1f84eb7eb2bd056709f93c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ioan=20Biz=C4=83u?= Date: Wed, 21 May 2025 13:51:26 +0200 Subject: [PATCH] fix(core): address later comments on ETH approve flow [no changelog] --- core/src/apps/ethereum/sign_tx.py | 2 +- core/src/trezor/ui/layouts/bolt/__init__.py | 4 +++- core/src/trezor/ui/layouts/caesar/__init__.py | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/apps/ethereum/sign_tx.py b/core/src/apps/ethereum/sign_tx.py index a9ede5514a..4de0fae6b4 100644 --- a/core/src/apps/ethereum/sign_tx.py +++ b/core/src/apps/ethereum/sign_tx.py @@ -256,7 +256,7 @@ async def _handle_erc20( # arg0: address, Address, 20 bytes (left padded with zeroes) # arg1: value, uint256, 32 bytes - if data_reader.remaining_count() < SC_FUNC_SIG_BYTES * 2: + if data_reader.remaining_count() < SC_ARGUMENT_BYTES * 2: return token, token_address, None, recipient, value arg0 = data_reader.read_memoryview(SC_ARGUMENT_BYTES) assert all( diff --git a/core/src/trezor/ui/layouts/bolt/__init__.py b/core/src/trezor/ui/layouts/bolt/__init__.py index 30123e425b..04edf479e6 100644 --- a/core/src/trezor/ui/layouts/bolt/__init__.py +++ b/core/src/trezor/ui/layouts/bolt/__init__.py @@ -19,6 +19,8 @@ CONFIRMED = trezorui_api.CONFIRMED CANCELLED = trezorui_api.CANCELLED INFO = trezorui_api.INFO +DOWN_ARROW = "V" + def confirm_action( br_name: str, @@ -552,7 +554,7 @@ async def _confirm_ask_pagination( [(description, False), (data, True)], br_name=br_name, br_code=br_code, - confirm="V" if extra_confirmation_if_not_read else None, + confirm=DOWN_ARROW if extra_confirmation_if_not_read else None, ): if extra_confirmation_if_not_read: try: diff --git a/core/src/trezor/ui/layouts/caesar/__init__.py b/core/src/trezor/ui/layouts/caesar/__init__.py index a5169cc4ae..bc86324ee1 100644 --- a/core/src/trezor/ui/layouts/caesar/__init__.py +++ b/core/src/trezor/ui/layouts/caesar/__init__.py @@ -17,6 +17,7 @@ CONFIRMED = trezorui_api.CONFIRMED CANCELLED = trezorui_api.CANCELLED INFO = trezorui_api.INFO +DOWN_ARROW = "V" BR_CODE_OTHER = ButtonRequestType.Other # global_import_cache @@ -931,7 +932,7 @@ if not utils.BITCOIN_ONLY: TR.ethereum__token_contract + " | " + TR.words__address, token_address, None, - verb="V", + verb=DOWN_ARROW, hold=False, br_name="confirm_ethereum_approve", chunkify=chunkify, @@ -943,7 +944,7 @@ if not utils.BITCOIN_ONLY: TR.ethereum__approve_chain_id, chain_id, None, - verb="V", + verb=DOWN_ARROW, hold=False, br_name="confirm_ethereum_approve", )