Skip to content

Commit 03e9ad0

Browse files
committed
fixup! refactor(core): improved Stellar transaction signing interface for a more streamlined user experience.
1 parent 26d4e8f commit 03e9ad0

File tree

5 files changed

+47
-32
lines changed

5 files changed

+47
-32
lines changed

core/src/apps/stellar/layout.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ async def require_confirm_final(
7474
if timebonuds_start > 0
7575
else TR.stellar__no_restriction
7676
),
77+
None,
7778
),
7879
(
7980
TR.stellar__valid_to,
@@ -82,6 +83,7 @@ async def require_confirm_final(
8283
if timebonuds_end > 0
8384
else TR.stellar__no_restriction
8485
),
86+
None,
8587
),
8688
]
8789

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,16 +1378,16 @@ def confirm_stellar_tx(
13781378
account_name: str,
13791379
account_path: str,
13801380
is_sending_from_trezor_account: bool,
1381-
extra_items: Iterable[tuple[str, str]],
1381+
extra_items: Iterable[PropertyType],
13821382
) -> Awaitable[None]:
13831383
return _confirm_summary(
13841384
None,
13851385
None,
13861386
fee,
13871387
TR.send__maximum_fee,
13881388
account_items=[
1389-
(TR.words__account, account_name),
1390-
(TR.address_details__derivation_path, account_path),
1389+
(TR.words__account, account_name, None),
1390+
(TR.address_details__derivation_path, account_path, None),
13911391
],
13921392
account_title=(
13931393
TR.send__send_from
@@ -1418,7 +1418,11 @@ async def confirm_stellar_output(
14181418
info_items = []
14191419
if asset.type != StellarAssetType.NATIVE:
14201420
info_items = [
1421-
(TR.stellar__issuer_template.format(asset.code), asset.issuer or "")
1421+
(
1422+
TR.stellar__issuer_template.format(asset.code),
1423+
asset.issuer or "",
1424+
None,
1425+
)
14221426
]
14231427

14241428
await confirm_value(

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,7 @@ def confirm_stellar_tx(
14201420
account_name: str,
14211421
account_path: str,
14221422
is_sending_from_trezor_account: bool,
1423-
extra_items: Iterable[tuple[str, str]],
1423+
extra_items: Iterable[PropertyType],
14241424
) -> Awaitable[None]:
14251425
return raise_if_cancelled(
14261426
trezorui_api.confirm_summary(
@@ -1429,15 +1429,15 @@ def confirm_stellar_tx(
14291429
fee=fee,
14301430
fee_label=TR.send__maximum_fee,
14311431
account_items=[
1432-
(TR.words__account, account_name),
1433-
(TR.address_details__derivation_path, account_path),
1432+
(TR.words__account, account_name, None),
1433+
(TR.address_details__derivation_path, account_path, None),
14341434
],
14351435
account_title=(
14361436
TR.send__send_from
14371437
if is_sending_from_trezor_account
14381438
else TR.stellar__sign_with
14391439
),
1440-
extra_items=extra_items,
1440+
extra_items=list(extra_items),
14411441
extra_title=TR.stellar__timebounds,
14421442
),
14431443
br_name="confirm_stellar_tx",
@@ -1463,7 +1463,11 @@ async def confirm_stellar_output(
14631463
info_items = []
14641464
if asset.type != StellarAssetType.NATIVE:
14651465
info_items = [
1466-
(TR.stellar__issuer_template.format(asset.code), asset.issuer or "")
1466+
(
1467+
TR.stellar__issuer_template.format(asset.code),
1468+
asset.issuer or "",
1469+
None,
1470+
)
14671471
]
14681472

14691473
await confirm_value(

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ async def confirm_payment_request(
557557
TR.words__transaction_fee,
558558
TR.words__title_summary,
559559
account_items,
560+
None,
560561
fee_info_items,
561562
TR.confirm_total__title_fee,
562563
"confirm_payment_request",
@@ -1145,7 +1146,6 @@ async def confirm_trade(
11451146

11461147
await confirm_with_menu(trade_layout, menu, "confirm_trade")
11471148

1148-
11491149
async def confirm_ethereum_staking_tx(
11501150
title: str,
11511151
intro_question: str,
@@ -1313,16 +1313,16 @@ def confirm_stellar_tx(
13131313
account_name: str,
13141314
account_path: str,
13151315
is_sending_from_trezor_account: bool,
1316-
extra_items: Iterable[tuple[str, str]],
1316+
extra_items: Iterable[PropertyType],
13171317
) -> Awaitable[None]:
13181318
return _confirm_summary(
13191319
None,
13201320
None,
13211321
fee,
13221322
TR.send__maximum_fee,
13231323
account_items=[
1324-
(TR.words__account, account_name),
1325-
(TR.address_details__derivation_path, account_path),
1324+
(TR.words__account, account_name, None),
1325+
(TR.address_details__derivation_path, account_path, None),
13261326
],
13271327
account_title=(
13281328
TR.send__send_from
@@ -1355,7 +1355,11 @@ async def confirm_stellar_output(
13551355
info_items = []
13561356
if asset.type != StellarAssetType.NATIVE:
13571357
info_items = [
1358-
(TR.stellar__issuer_template.format(asset.code), asset.issuer or "")
1358+
(
1359+
TR.stellar__issuer_template.format(asset.code),
1360+
asset.issuer or "",
1361+
None,
1362+
)
13591363
]
13601364

13611365
await confirm_value(
@@ -1366,8 +1370,6 @@ async def confirm_stellar_output(
13661370
br_name="confirm_output_amount",
13671371
br_code=ButtonRequestType.ConfirmOutput,
13681372
info_items=info_items,
1369-
info_title=TR.stellar__token_info,
1370-
chunkify_info=True,
13711373
chunkify=False,
13721374
)
13731375

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

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
TypeVar,
2020
)
2121

22-
from trezor.ui.layouts.menu import Details
23-
2422
from trezor.messages import StellarAsset
23+
from trezor.ui.layouts.menu import Details
2524

2625
from ..common import ExceptionType, PropertyType
2726

@@ -562,16 +561,16 @@ async def confirm_payment_request(
562561

563562
if transaction_fee is not None:
564563
res = await _confirm_summary(
565-
None,
566-
None,
567-
transaction_fee,
568-
TR.words__transaction_fee,
569-
TR.words__swap if is_swap else TR.words__title_summary,
570-
account_items,
571-
fee_info_items,
572-
TR.confirm_total__title_fee,
573-
True,
574-
"confirm_payment_request",
564+
amount=None,
565+
amount_label=None,
566+
fee=transaction_fee,
567+
fee_label=TR.words__transaction_fee,
568+
title=TR.words__swap if is_swap else TR.words__title_summary,
569+
account_items=account_items,
570+
extra_items=fee_info_items,
571+
extra_title=TR.confirm_total__title_fee,
572+
back_button=True,
573+
br_name="confirm_payment_request",
575574
)
576575
if res is BACK:
577576
continue
@@ -1360,16 +1359,16 @@ def confirm_stellar_tx(
13601359
account_name: str,
13611360
account_path: str,
13621361
is_sending_from_trezor_account: bool,
1363-
extra_items: Iterable[tuple[str, str]],
1362+
extra_items: Iterable[PropertyType],
13641363
) -> Awaitable[None]:
13651364
return _confirm_summary(
13661365
None,
13671366
None,
13681367
fee,
13691368
TR.send__maximum_fee,
13701369
account_items=[
1371-
(TR.words__account, account_name),
1372-
(TR.address_details__derivation_path, account_path),
1370+
(TR.words__account, account_name, None),
1371+
(TR.address_details__derivation_path, account_path, None),
13731372
],
13741373
account_title=(
13751374
TR.send__send_from
@@ -1402,7 +1401,11 @@ async def confirm_stellar_output(
14021401
info_items = []
14031402
if asset.type != StellarAssetType.NATIVE:
14041403
info_items = [
1405-
(TR.stellar__issuer_template.format(asset.code), asset.issuer or "")
1404+
(
1405+
TR.stellar__issuer_template.format(asset.code),
1406+
asset.issuer or "",
1407+
None,
1408+
)
14061409
]
14071410

14081411
await confirm_value(

0 commit comments

Comments
 (0)