refactor(core): remove upper() calls in mercury

[no changelog]
mmilata/ui-t3t1-preview
obrusvit 4 weeks ago
parent 72cc22176f
commit 63ce65827b

@ -251,11 +251,6 @@ async def confirm_action(
exc: ExceptionType = ActionCancelled,
br_code: ButtonRequestType = BR_TYPE_OTHER,
) -> None:
if verb is not None:
verb = verb.upper()
if verb_cancel is not None:
verb_cancel = verb_cancel.upper()
if description is not None and description_param is not None:
description = description.format(description_param)
@ -288,8 +283,6 @@ async def confirm_single(
description_param: str | None = None,
verb: str | None = None,
) -> None:
if verb is not None:
verb = verb.upper()
description_param = description_param or ""
# Placeholders are coming from translations in form of {0}
@ -302,7 +295,7 @@ async def confirm_single(
interact(
RustLayout(
trezorui2.confirm_emphasized(
title=title.upper(),
title=title,
items=(begin, (True, description_param), end),
verb=verb,
)
@ -463,7 +456,7 @@ def show_pubkey(
mismatch_title = mismatch_title or TR.addr_mismatch__key_mismatch # def_arg
return show_address(
address=pubkey,
title=title.upper(),
title=title,
account=account,
path=path,
br_type=br_type,
@ -486,7 +479,7 @@ async def show_error_and_raise(
trezorui2.show_error(
title=subheader or "",
description=content,
button=button.upper(),
button=button,
allow_cancel=False,
)
),
@ -629,10 +622,10 @@ async def should_show_more(
result = await interact(
RustLayout(
trezorui2.confirm_with_info(
title=title.upper(),
title=title,
items=para,
button=confirm.upper(),
info_button=button_text.upper(),
button=confirm,
info_button=button_text,
)
),
br_type,
@ -700,7 +693,6 @@ async def confirm_blob(
chunkify: bool = False,
) -> None:
verb = verb or TR.buttons__confirm # def_arg
title = title.upper()
layout = RustLayout(
trezorui2.confirm_blob(
title=title,
@ -800,9 +792,6 @@ def confirm_value(
if not verb and not hold:
raise ValueError("Either verb or hold=True must be set")
if verb:
verb = verb.upper()
info_items = info_items or []
info_layout = RustLayout(
trezorui2.show_info_with_cancel(
@ -816,7 +805,7 @@ def confirm_value(
with_info(
RustLayout(
trezorui2.confirm_value(
title=title.upper(),
title=title,
subtitle=subtitle,
description=description,
value=value,
@ -847,7 +836,7 @@ async def confirm_properties(
interact(
RustLayout(
trezorui2.confirm_properties(
title=title.upper(),
title=title,
items=items,
hold=hold,
)
@ -915,7 +904,7 @@ async def confirm_summary(
total_layout = RustLayout(
trezorui2.confirm_total(
title=title.upper(),
title=title,
items=items,
info_button=bool(info_items),
)
@ -923,7 +912,7 @@ async def confirm_summary(
info_items = info_items or []
info_layout = RustLayout(
trezorui2.show_info_with_cancel(
title=info_title.upper() if info_title else TR.words__title_information,
title=info_title if info_title else TR.words__title_information,
items=info_items,
)
)
@ -963,7 +952,7 @@ if not utils.BITCOIN_ONLY:
# Allowing going back and forth between recipient and summary/details
await confirm_blob(
br_type,
TR.words__recipient.upper(),
TR.words__recipient,
recipient,
verb=TR.buttons__continue,
chunkify=chunkify,
@ -1074,11 +1063,11 @@ async def confirm_metadata(
verb = verb or TR.buttons__continue # def_arg
await confirm_action(
br_type,
title=title.upper(),
title=title,
action="",
description=content,
description_param=param,
verb=verb.upper(),
verb=verb,
hold=hold,
br_code=br_code,
)
@ -1087,7 +1076,7 @@ async def confirm_metadata(
async def confirm_replacement(title: str, txid: str) -> None:
await confirm_blob(
"confirm_replacement",
title.upper(),
title,
txid,
TR.send__transaction_id,
TR.buttons__continue,
@ -1174,7 +1163,7 @@ async def confirm_modify_fee(
) -> None:
fee_layout = RustLayout(
trezorui2.confirm_modify_fee(
title=title.upper(),
title=title,
sign=sign,
user_fee_change=user_fee_change,
total_fee_new=total_fee_new,

@ -56,7 +56,7 @@ async def confirm_fido(
"""Webauthn confirmation for one or more credentials."""
confirm = _RustFidoLayout(
trezorui2.confirm_fido(
title=header.upper(),
title=header,
app_name=app_name,
icon_name=icon_name,
accounts=accounts,

@ -39,7 +39,7 @@ def progress(
message = message or TR.progress__please_wait # def_arg
return RustProgress(
layout=trezorui2.show_progress(
title=message.upper(),
title=message,
indeterminate=indeterminate,
description=description or "",
)

@ -132,7 +132,7 @@ async def continue_recovery(
trezorui2.confirm_recovery(
title=text,
description=description,
button=button_label.upper(),
button=button_label,
info_button=info_func is not None,
dry_run=dry_run,
)

@ -139,7 +139,7 @@ async def _prompt_number(
) -> int:
num_input = RustLayout(
trezorui2.request_number(
title=title.upper(),
title=title,
description=description,
count=count,
min_count=min_count,

Loading…
Cancel
Save