mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-25 08:58:14 +00:00
fixup! fixup! refactor(core): drop confirm_blob_with_optional_pagination
This commit is contained in:
parent
4ede5370e4
commit
7abacb3ff7
@ -176,9 +176,16 @@ def require_confirm_address(address_bytes: bytes) -> Awaitable[None]:
|
|||||||
|
|
||||||
|
|
||||||
def require_confirm_other_data(data: bytes, data_total: int) -> Awaitable[None]:
|
def require_confirm_other_data(data: bytes, data_total: int) -> Awaitable[None]:
|
||||||
from trezor.ui.layouts import confirm_other_data
|
return confirm_blob(
|
||||||
|
"confirm_data",
|
||||||
return confirm_other_data(data, data_total)
|
TR.ethereum__title_input_data,
|
||||||
|
data,
|
||||||
|
TR.ethereum__data_size_template.format(data_total),
|
||||||
|
verb=TR.buttons__confirm,
|
||||||
|
verb_cancel=TR.send__cancel_sign,
|
||||||
|
br_code=ButtonRequestType.SignTx,
|
||||||
|
ask_pagination=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
async def confirm_typed_data_final() -> None:
|
async def confirm_typed_data_final() -> None:
|
||||||
|
@ -715,18 +715,6 @@ def _confirm_summary(
|
|||||||
|
|
||||||
if not utils.BITCOIN_ONLY:
|
if not utils.BITCOIN_ONLY:
|
||||||
|
|
||||||
def confirm_other_data(data: bytes, data_total: int) -> Awaitable[None]:
|
|
||||||
return confirm_blob(
|
|
||||||
"confirm_data",
|
|
||||||
TR.ethereum__title_input_data,
|
|
||||||
data,
|
|
||||||
TR.ethereum__data_size_template.format(data_total),
|
|
||||||
verb=TR.buttons__confirm,
|
|
||||||
verb_cancel=TR.send__cancel_sign,
|
|
||||||
br_code=ButtonRequestType.SignTx,
|
|
||||||
ask_pagination=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
def confirm_ethereum_unknown_contract_warning() -> Awaitable[None]:
|
def confirm_ethereum_unknown_contract_warning() -> Awaitable[None]:
|
||||||
return raise_if_not_confirmed(
|
return raise_if_not_confirmed(
|
||||||
trezorui2.flow_warning_hi_prio(
|
trezorui2.flow_warning_hi_prio(
|
||||||
|
@ -559,7 +559,7 @@ def confirm_blob(
|
|||||||
text_mono: bool = True,
|
text_mono: bool = True,
|
||||||
subtitle: str | None = None,
|
subtitle: str | None = None,
|
||||||
verb: str | None = None,
|
verb: str | None = None,
|
||||||
verb_cancel: str | None = "", # icon
|
verb_cancel: str | None = None, # icon
|
||||||
info: bool = True,
|
info: bool = True,
|
||||||
hold: bool = False,
|
hold: bool = False,
|
||||||
br_code: ButtonRequestType = BR_CODE_OTHER,
|
br_code: ButtonRequestType = BR_CODE_OTHER,
|
||||||
@ -573,7 +573,7 @@ def confirm_blob(
|
|||||||
description=description,
|
description=description,
|
||||||
data=data,
|
data=data,
|
||||||
verb=verb,
|
verb=verb,
|
||||||
verb_cancel=verb_cancel,
|
verb_cancel=None,
|
||||||
hold=hold,
|
hold=hold,
|
||||||
chunkify=chunkify,
|
chunkify=chunkify,
|
||||||
)
|
)
|
||||||
@ -581,7 +581,7 @@ def confirm_blob(
|
|||||||
if ask_pagination and layout.page_count() > 1:
|
if ask_pagination and layout.page_count() > 1:
|
||||||
assert not hold
|
assert not hold
|
||||||
return _confirm_ask_pagination(
|
return _confirm_ask_pagination(
|
||||||
br_name, title, data, description or "", verb_cancel, br_code
|
br_name, title, data, description or "", br_code
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
return raise_if_not_confirmed(layout, br_name, br_code)
|
return raise_if_not_confirmed(layout, br_name, br_code)
|
||||||
@ -592,7 +592,6 @@ async def _confirm_ask_pagination(
|
|||||||
title: str,
|
title: str,
|
||||||
data: bytes | str,
|
data: bytes | str,
|
||||||
description: str,
|
description: str,
|
||||||
verb_cancel: str | None,
|
|
||||||
br_code: ButtonRequestType,
|
br_code: ButtonRequestType,
|
||||||
) -> None:
|
) -> None:
|
||||||
# TODO: make should_show_more/confirm_more accept bytes directly
|
# TODO: make should_show_more/confirm_more accept bytes directly
|
||||||
@ -611,7 +610,7 @@ async def _confirm_ask_pagination(
|
|||||||
if not await should_show_more(
|
if not await should_show_more(
|
||||||
title,
|
title,
|
||||||
para=[(ui.NORMAL, description), (ui.MONO, data)],
|
para=[(ui.NORMAL, description), (ui.MONO, data)],
|
||||||
verb_cancel=verb_cancel,
|
verb_cancel=None,
|
||||||
br_name=br_name,
|
br_name=br_name,
|
||||||
br_code=br_code,
|
br_code=br_code,
|
||||||
):
|
):
|
||||||
@ -805,19 +804,6 @@ def confirm_total(
|
|||||||
|
|
||||||
|
|
||||||
if not utils.BITCOIN_ONLY:
|
if not utils.BITCOIN_ONLY:
|
||||||
|
|
||||||
def confirm_other_data(data: bytes, data_total: int) -> Awaitable[None]:
|
|
||||||
return confirm_blob(
|
|
||||||
"confirm_data",
|
|
||||||
TR.ethereum__title_input_data,
|
|
||||||
data,
|
|
||||||
TR.ethereum__data_size_template.format(data_total),
|
|
||||||
verb=TR.buttons__confirm,
|
|
||||||
verb_cancel=None,
|
|
||||||
br_code=ButtonRequestType.SignTx,
|
|
||||||
ask_pagination=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
def confirm_ethereum_unknown_contract_warning() -> Awaitable[ui.UiResult]:
|
def confirm_ethereum_unknown_contract_warning() -> Awaitable[ui.UiResult]:
|
||||||
return show_warning(
|
return show_warning(
|
||||||
"unknown_contract_warning",
|
"unknown_contract_warning",
|
||||||
@ -1116,13 +1102,18 @@ async def confirm_signverify(
|
|||||||
br_code=BR_CODE_OTHER,
|
br_code=BR_CODE_OTHER,
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await confirm_blob(
|
await raise_if_not_confirmed(
|
||||||
br_name,
|
trezorui2.confirm_blob(
|
||||||
TR.sign_message__confirm_message,
|
title=TR.sign_message__confirm_message,
|
||||||
message,
|
description=None,
|
||||||
|
data=message,
|
||||||
|
verb=None,
|
||||||
verb_cancel="^",
|
verb_cancel="^",
|
||||||
br_code=BR_CODE_OTHER,
|
hold=False,
|
||||||
ask_pagination=True,
|
chunkify=chunkify,
|
||||||
|
),
|
||||||
|
br_name,
|
||||||
|
BR_CODE_OTHER,
|
||||||
)
|
)
|
||||||
except ActionCancelled:
|
except ActionCancelled:
|
||||||
continue
|
continue
|
||||||
|
@ -574,7 +574,7 @@ def confirm_blob(
|
|||||||
data=data,
|
data=data,
|
||||||
hold=hold,
|
hold=hold,
|
||||||
verb=verb,
|
verb=verb,
|
||||||
verb_cancel=verb_cancel,
|
verb_cancel=None,
|
||||||
chunkify=chunkify,
|
chunkify=chunkify,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -770,18 +770,6 @@ def _confirm_summary(
|
|||||||
|
|
||||||
if not utils.BITCOIN_ONLY:
|
if not utils.BITCOIN_ONLY:
|
||||||
|
|
||||||
def confirm_other_data(data: bytes, data_total: int) -> Awaitable[None]:
|
|
||||||
return confirm_blob(
|
|
||||||
"confirm_data",
|
|
||||||
TR.ethereum__title_input_data,
|
|
||||||
data,
|
|
||||||
TR.ethereum__data_size_template.format(data_total),
|
|
||||||
verb=TR.buttons__confirm,
|
|
||||||
verb_cancel=None,
|
|
||||||
br_code=ButtonRequestType.SignTx,
|
|
||||||
ask_pagination=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
def confirm_ethereum_unknown_contract_warning() -> Awaitable[None]:
|
def confirm_ethereum_unknown_contract_warning() -> Awaitable[None]:
|
||||||
return show_warning(
|
return show_warning(
|
||||||
"unknown_contract_warning",
|
"unknown_contract_warning",
|
||||||
|
@ -216,10 +216,6 @@ class InputFlowSignMessagePagination(InputFlowBase):
|
|||||||
yield
|
yield
|
||||||
self.debug.press_yes()
|
self.debug.press_yes()
|
||||||
|
|
||||||
# press info
|
|
||||||
yield
|
|
||||||
self.debug.press_right()
|
|
||||||
|
|
||||||
# paginate through the whole message
|
# paginate through the whole message
|
||||||
br = yield
|
br = yield
|
||||||
# TODO: try load the message_read the same way as in model T
|
# TODO: try load the message_read the same way as in model T
|
||||||
|
Loading…
Reference in New Issue
Block a user