1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-26 12:09:02 +00:00

core/shamir: fix texts

This commit is contained in:
Tomas Susanka 2019-07-29 10:52:21 +02:00
parent 5584939fd3
commit 81a1b26fad
5 changed files with 39 additions and 27 deletions

View File

@ -83,8 +83,8 @@ async def request_pin_ack(ctx, *args, **kwargs):
async def pin_mismatch(): async def pin_mismatch():
text = Text("PIN mismatch", ui.ICON_WRONG, ui.RED) text = Text("PIN mismatch", ui.ICON_WRONG, ui.RED)
text.normal("Entered PINs do not", "match each other.") text.normal("The PINs you entered", "do not match.")
text.normal("") text.normal("")
text.normal("Please, try again...") text.normal("Please try again.")
popup = Popup(text, 3000) # show for 3 seconds popup = Popup(text, 3000) # show for 3 seconds
await popup await popup

View File

@ -115,9 +115,9 @@ async def _show_confirmation_success(
): ):
if share_index is None or num_of_shares is None or share_index == num_of_shares - 1: if share_index is None or num_of_shares is None or share_index == num_of_shares - 1:
if slip39: if slip39:
subheader = ("You finished verifying", "your recovery shares.") subheader = ("You have finished", "verifying your", "recovery shares.")
else: else:
subheader = ("You finished verifying", "your recovery seed.") subheader = ("You have finished", "verifying your", "recovery seed.")
text = [] text = []
else: else:
subheader = ("Recovery share #%s" % (share_index + 1), "checked successfully.") subheader = ("Recovery share #%s" % (share_index + 1), "checked successfully.")

View File

@ -25,7 +25,7 @@ async def recovery_device(ctx: wire.Context, msg: RecoveryDevice) -> Success:
if not msg.dry_run: if not msg.dry_run:
title = "Recovery mode" title = "Recovery mode"
text = Text(title, ui.ICON_RECOVERY) text = Text(title, ui.ICON_RECOVERY)
text.normal("Do you really want to", "recover the wallet?", "") text.normal("Do you really want to", "recover a wallet?", "")
else: else:
title = "Seed check" title = "Seed check"
text = Text(title, ui.ICON_RECOVERY) text = Text(title, ui.ICON_RECOVERY)

View File

@ -76,7 +76,7 @@ async def _finish_recovery_dry_run(
== storage.recovery.get_slip39_iteration_exponent() == storage.recovery.get_slip39_iteration_exponent()
) )
await layout.show_dry_run_result(ctx, result) await layout.show_dry_run_result(ctx, result, mnemonic_type)
storage.recovery.end_progress() storage.recovery.end_progress()

View File

@ -86,25 +86,41 @@ async def request_mnemonic(
return " ".join(words) return " ".join(words)
async def show_dry_run_result(ctx: wire.Context, result: bool) -> None: async def show_dry_run_result(
ctx: wire.Context, result: bool, mnemonic_type: int
) -> None:
if result: if result:
await show_success( if mnemonic_type == mnemonic.TYPE_SLIP39:
ctx, text = (
(
"The entered recovery", "The entered recovery",
"seed is valid and matches", "shares are valid and",
"the one in the device.", "match what is currently",
), "in the device.",
) )
else: else:
await show_warning( text = (
ctx,
(
"The entered recovery", "The entered recovery",
"seed is valid but does not", "seed is valid and",
"match the one in the device.", "matches the one",
), "in the device.",
) )
await show_success(ctx, text, button="Continue")
else:
if mnemonic_type == mnemonic.TYPE_SLIP39:
text = (
"The entered recovery",
"shares are valid but",
"do not match what is",
"currently in the device.",
)
else:
text = (
"The entered recovery",
"seed is valid but does",
"not match the one",
"in the device.",
)
await show_warning(ctx, text, button="Continue")
async def show_dry_run_different_type(ctx: wire.Context) -> None: async def show_dry_run_different_type(ctx: wire.Context) -> None:
@ -136,13 +152,9 @@ async def show_keyboard_info(ctx: wire.Context) -> None:
async def show_invalid_mnemonic(ctx, mnemonic_type: int): async def show_invalid_mnemonic(ctx, mnemonic_type: int):
if mnemonic_type == mnemonic.TYPE_SLIP39: if mnemonic_type == mnemonic.TYPE_SLIP39:
await show_warning( await show_warning(ctx, ("You have entered", "an invalid recovery", "share."))
ctx, ("You have entered", "a recovery share", "that is not valid.")
)
else: else:
await show_warning( await show_warning(ctx, ("You have entered", "an invalid recovery", "seed."))
ctx, ("You have entered", "a recovery seed", "that is not valid.")
)
async def show_share_already_added(ctx): async def show_share_already_added(ctx):