1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 14:28:07 +00:00

refactor(core/stellar): replace confirm_timebounds_stellar with confirm_properties

This commit is contained in:
matejcik 2021-08-06 14:12:26 +02:00 committed by matejcik
parent 1dcfdebf7a
commit c30091b9c5
2 changed files with 10 additions and 25 deletions

View File

@ -5,8 +5,8 @@ from trezor.ui.layouts import (
confirm_address,
confirm_blob,
confirm_metadata,
confirm_properties,
)
from trezor.ui.layouts.tt.altcoin import confirm_timebounds_stellar
from trezor.wire import DataError
from . import consts
@ -51,7 +51,15 @@ async def require_confirm_init(
async def require_confirm_timebounds(ctx: Context, start: int, end: int) -> None:
await confirm_timebounds_stellar(ctx, start, end)
await confirm_properties(
ctx,
"confirm_timebounds",
title="Confirm timebounds",
props=(
("Valid from (UTC)", str(start) if start > 0 else "[no restriction]"),
("Valid to (UTC)", str(end) if end > 0 else "[no restriction]"),
),
)
async def require_confirm_memo(

View File

@ -43,29 +43,6 @@ async def confirm_total_ripple(
)
async def confirm_timebounds_stellar(
ctx: wire.GenericContext, start: int, end: int
) -> None:
text = Text("Confirm timebounds", ui.ICON_SEND, ui.GREEN)
text.bold("Valid from (UTC):")
if start:
text.normal(str(start))
else:
text.mono("[no restriction]")
text.bold("Valid to (UTC):")
if end:
text.normal(str(end))
else:
text.mono("[no restriction]")
await raise_if_cancelled(
interact(
ctx, Confirm(text), "confirm_timebounds", ButtonRequestType.ConfirmOutput
)
)
async def confirm_transfer_binance(
ctx: wire.GenericContext, inputs_outputs: Sequence[tuple[str, str, str]]
) -> None: