Skip to content

Commit be392da

Browse files
committed
refactor(core): scope payment request text confirmation layouts
May be related to the following OOM: https://github.com/trezor/trezor-firmware/actions/runs/24751684853/job/72416000050 [no changelog]
1 parent 9687d46 commit be392da

4 files changed

Lines changed: 27 additions & 35 deletions

File tree

core/src/trezor/ui/layouts/bolt/__init__.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -503,15 +503,13 @@ async def confirm_payment_request(
503503
title = TR.words__swap if is_swap(trades) else TR.words__confirm
504504

505505
for t, text in texts:
506-
await raise_if_not_confirmed(
507-
trezorui_api.confirm_value(
508-
title=t or title,
509-
value=text,
510-
is_data=False,
511-
description=None,
512-
),
513-
"confirm_payment_request",
514-
)
506+
with trezorui_api.confirm_value(
507+
title=t or title,
508+
value=text,
509+
is_data=False,
510+
description=None,
511+
) as obj:
512+
await raise_if_not_confirmed(obj, "confirm_payment_request")
515513

516514
menu_items: list[StrPropertyType] = []
517515
if recipient_address is not None:

core/src/trezor/ui/layouts/caesar/__init__.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -571,14 +571,12 @@ async def confirm_payment_request(
571571
title = TR.words__swap if is_swap(trades) else TR.words__confirm
572572

573573
for t, text in texts:
574-
await raise_if_not_confirmed(
575-
trezorui_api.confirm_value(
576-
title=t or title,
577-
value=text,
578-
description=None,
579-
),
580-
"confirm_payment_request",
581-
)
574+
with trezorui_api.confirm_value(
575+
title=t or title,
576+
value=text,
577+
description=None,
578+
) as obj:
579+
await raise_if_not_confirmed(obj, "confirm_payment_request")
582580

583581
menu_items = []
584582
if recipient_address is not None:

core/src/trezor/ui/layouts/delizia/__init__.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -509,15 +509,13 @@ async def confirm_payment_request(
509509
title = TR.words__swap if is_swap(trades) else TR.words__confirm
510510

511511
for t, text in texts:
512-
await raise_if_not_confirmed(
513-
trezorui_api.confirm_value(
514-
title=t or title,
515-
value=text,
516-
is_data=False,
517-
description=None,
518-
),
519-
"confirm_payment_request",
520-
)
512+
with trezorui_api.confirm_value(
513+
title=t or title,
514+
value=text,
515+
is_data=False,
516+
description=None,
517+
) as obj:
518+
await raise_if_not_confirmed(obj, "confirm_payment_request")
521519

522520
main_layout = trezorui_api.confirm_value(
523521
title=title,

core/src/trezor/ui/layouts/eckhart/__init__.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -472,15 +472,13 @@ async def confirm_payment_request(
472472
)
473473

474474
for t, text in texts:
475-
await raise_if_not_confirmed(
476-
trezorui_api.confirm_value(
477-
title=t or title,
478-
value=text,
479-
description=None,
480-
verb=TR.buttons__confirm,
481-
),
482-
"confirm_payment_request",
483-
)
475+
with trezorui_api.confirm_value(
476+
title=t or title,
477+
value=text,
478+
description=None,
479+
verb=TR.buttons__confirm,
480+
) as obj:
481+
await raise_if_not_confirmed(obj, "confirm_payment_request")
484482

485483
main_layout = trezorui_api.confirm_value(
486484
title=title,

0 commit comments

Comments
 (0)