From 63e35e13edd83711a14f9e5ce8ece331ee8e6cd1 Mon Sep 17 00:00:00 2001 From: gabrielkerekes Date: Tue, 5 Dec 2023 14:05:29 +0100 Subject: [PATCH] fix(solana): modify Trezor R `confirm_value` to align messages with Trezor T --- core/src/trezor/ui/layouts/tr/__init__.py | 56 +++++++++++++++-------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/core/src/trezor/ui/layouts/tr/__init__.py b/core/src/trezor/ui/layouts/tr/__init__.py index 64da10cee..fa4ccb2aa 100644 --- a/core/src/trezor/ui/layouts/tr/__init__.py +++ b/core/src/trezor/ui/layouts/tr/__init__.py @@ -966,29 +966,47 @@ async def confirm_value( if len(info_items_list) > 1: raise NotImplementedError("Only one info item is supported") + send_button_request = True while True: - should_show_info = await should_show_more( - title, - para=((ui.NORMAL, value),), - button_text="INFO", - br_type=br_type, - br_code=br_code, + should_show_more_layout = RustLayout( + trezorui2.confirm_with_info( + title=title.upper(), + items=((ui.NORMAL, value),), + button="CONFIRM", + info_button="INFO", + ) ) - if not should_show_info: - return - - try: - info_title, info_value = info_items_list[0] - await confirm_action( - br_type="confirm_value_info", - title=info_title, - action=info_value, - verb="BACK", - verb_cancel="<", + if send_button_request: + send_button_request = False + await button_request( + br_type, + br_code, + should_show_more_layout.page_count(), ) - except ActionCancelled: - continue + + result = await ctx_wait(should_show_more_layout) + + if result is CONFIRMED: + break + elif result is INFO: + info_title, info_value = info_items_list[0] + await ctx_wait( + RustLayout( + trezorui2.confirm_action( + title=info_title.upper(), + action=info_value, + description=description, + verb="BACK", + verb_cancel="<", + hold=False, + reverse=False, + ) + ) + ) + else: + assert result is CANCELLED + raise ActionCancelled async def confirm_total(