fix(solana): modify Trezor R `confirm_value` to align messages with Trezor T

vacuum/feat/solana
gabrielkerekes 6 months ago
parent 330cf0ea07
commit 5922988cad

@ -966,29 +966,52 @@ async def confirm_value(
if len(info_items_list) > 1: if len(info_items_list) > 1:
raise NotImplementedError("Only one info item is supported") raise NotImplementedError("Only one info item is supported")
while True: should_show_more_layout = RustLayout(
should_show_info = await should_show_more( trezorui2.confirm_with_info(
title, title=title.upper(),
para=((ui.NORMAL, value),), items=((ui.NORMAL, value),),
button_text="INFO", button="CONFIRM",
br_type=br_type, info_button="INFO",
br_code=br_code,
) )
)
info_title, info_value = info_items_list[0]
confirm_action_layout = RustLayout(
trezorui2.confirm_action(
title=info_title.upper(),
action=info_value,
description=description,
verb="BACK",
verb_cancel="<",
hold=False,
reverse=False,
)
)
if not should_show_info: send_button_request = True
return while True:
if send_button_request:
try: send_button_request = False
info_title, info_value = info_items_list[0] await button_request(
await confirm_action( br_type,
br_type="confirm_value_info", br_code,
title=info_title, should_show_more_layout.page_count(),
action=info_value,
verb="BACK",
verb_cancel="<",
) )
except ActionCancelled:
continue should_show_more_layout.request_complete_repaint()
result = await ctx_wait(should_show_more_layout)
if result is CONFIRMED:
break
elif result is INFO:
try:
confirm_action_layout.request_complete_repaint()
await ctx_wait(confirm_action_layout)
except ActionCancelled:
continue
else:
assert result is CANCELLED
raise ActionCancelled
async def confirm_total( async def confirm_total(

Loading…
Cancel
Save