From 81a1b26fade531c6b147884c477584678d598a02 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Mon, 29 Jul 2019 10:52:21 +0200 Subject: [PATCH] core/shamir: fix texts --- core/src/apps/management/change_pin.py | 4 +- core/src/apps/management/common/layout.py | 4 +- .../management/recovery_device/__init__.py | 2 +- .../management/recovery_device/homescreen.py | 2 +- .../apps/management/recovery_device/layout.py | 54 +++++++++++-------- 5 files changed, 39 insertions(+), 27 deletions(-) diff --git a/core/src/apps/management/change_pin.py b/core/src/apps/management/change_pin.py index a315b22d5..68f20a039 100644 --- a/core/src/apps/management/change_pin.py +++ b/core/src/apps/management/change_pin.py @@ -83,8 +83,8 @@ async def request_pin_ack(ctx, *args, **kwargs): async def pin_mismatch(): 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("Please, try again...") + text.normal("Please try again.") popup = Popup(text, 3000) # show for 3 seconds await popup diff --git a/core/src/apps/management/common/layout.py b/core/src/apps/management/common/layout.py index a1263edfe..e81e36e41 100644 --- a/core/src/apps/management/common/layout.py +++ b/core/src/apps/management/common/layout.py @@ -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 slip39: - subheader = ("You finished verifying", "your recovery shares.") + subheader = ("You have finished", "verifying your", "recovery shares.") else: - subheader = ("You finished verifying", "your recovery seed.") + subheader = ("You have finished", "verifying your", "recovery seed.") text = [] else: subheader = ("Recovery share #%s" % (share_index + 1), "checked successfully.") diff --git a/core/src/apps/management/recovery_device/__init__.py b/core/src/apps/management/recovery_device/__init__.py index 7048591ba..20e43c94f 100644 --- a/core/src/apps/management/recovery_device/__init__.py +++ b/core/src/apps/management/recovery_device/__init__.py @@ -25,7 +25,7 @@ async def recovery_device(ctx: wire.Context, msg: RecoveryDevice) -> Success: if not msg.dry_run: title = "Recovery mode" 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: title = "Seed check" text = Text(title, ui.ICON_RECOVERY) diff --git a/core/src/apps/management/recovery_device/homescreen.py b/core/src/apps/management/recovery_device/homescreen.py index 1492d069e..b7fbaabc1 100644 --- a/core/src/apps/management/recovery_device/homescreen.py +++ b/core/src/apps/management/recovery_device/homescreen.py @@ -76,7 +76,7 @@ async def _finish_recovery_dry_run( == 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() diff --git a/core/src/apps/management/recovery_device/layout.py b/core/src/apps/management/recovery_device/layout.py index 0aa953649..6d9a12876 100644 --- a/core/src/apps/management/recovery_device/layout.py +++ b/core/src/apps/management/recovery_device/layout.py @@ -86,25 +86,41 @@ async def request_mnemonic( 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: - await show_success( - ctx, - ( + if mnemonic_type == mnemonic.TYPE_SLIP39: + text = ( "The entered recovery", - "seed is valid and matches", - "the one in the device.", - ), - ) + "shares are valid and", + "match what is currently", + "in the device.", + ) + else: + text = ( + "The entered recovery", + "seed is valid and", + "matches the one", + "in the device.", + ) + await show_success(ctx, text, button="Continue") else: - await show_warning( - ctx, - ( + if mnemonic_type == mnemonic.TYPE_SLIP39: + text = ( "The entered recovery", - "seed is valid but does not", - "match the one in the device.", - ), - ) + "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: @@ -136,13 +152,9 @@ async def show_keyboard_info(ctx: wire.Context) -> None: async def show_invalid_mnemonic(ctx, mnemonic_type: int): if mnemonic_type == mnemonic.TYPE_SLIP39: - await show_warning( - ctx, ("You have entered", "a recovery share", "that is not valid.") - ) + await show_warning(ctx, ("You have entered", "an invalid recovery", "share.")) else: - await show_warning( - ctx, ("You have entered", "a recovery seed", "that is not valid.") - ) + await show_warning(ctx, ("You have entered", "an invalid recovery", "seed.")) async def show_share_already_added(ctx):