From f78e75bc38071e2c650cb0a7526cf529d923bffc Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Fri, 28 Jun 2019 11:56:57 +0200 Subject: [PATCH] core/slip39: add different wording for BIP/SLIP39 in backup warining --- core/src/apps/management/backup_device.py | 2 +- core/src/apps/management/common/layout.py | 47 ++++++++++------------- core/src/apps/management/reset_device.py | 4 +- 3 files changed, 25 insertions(+), 28 deletions(-) diff --git a/core/src/apps/management/backup_device.py b/core/src/apps/management/backup_device.py index 2e6579e38..63d13d434 100644 --- a/core/src/apps/management/backup_device.py +++ b/core/src/apps/management/backup_device.py @@ -13,7 +13,7 @@ async def backup_device(ctx, msg): raise wire.ProcessError("Seed already backed up") # warn user about mnemonic safety - await layout.bip39_show_backup_warning(ctx) + await layout.show_backup_warning(ctx, "Back up your seed", "I understand") storage.set_unfinished_backup(True) storage.set_backed_up() diff --git a/core/src/apps/management/common/layout.py b/core/src/apps/management/common/layout.py index 717026481..038254012 100644 --- a/core/src/apps/management/common/layout.py +++ b/core/src/apps/management/common/layout.py @@ -46,19 +46,6 @@ async def show_internal_entropy(ctx, entropy: bytes): await require_confirm(ctx, text, ButtonRequestType.ResetDevice) -async def show_backup_success(ctx): - text = Text("Backup is done!", ui.ICON_CONFIRM, ui.GREEN) - text.normal( - "Never make a digital", - "copy of your recovery", - "shares and never upload", - "them online!", - ) - await require_confirm( - ctx, text, ButtonRequestType.ResetDevice, confirm="Finish backup", cancel=None - ) - - async def confirm_backup(ctx): text = Text("Back up wallet", ui.ICON_RESET, new_lines=False) text.bold("New wallet created") @@ -169,6 +156,27 @@ async def _show_confirmation_failure(ctx, share_index): ) +async def show_backup_warning(ctx, header: str, confirm_text: str, slip39=False): + text = Text(header, ui.ICON_NOCOPY) + if slip39: + text.normal( + "Never make a digital", + "copy of your recovery", + "shares and never upload", + "them online!", + ) + else: + text.normal( + "Never make a digital", + "copy of your recovery", + "seed and never upload", + "it online!", + ) + await require_confirm( + ctx, text, ButtonRequestType.ResetDevice, confirm_text, cancel=None + ) + + # BIP39 # === @@ -188,19 +196,6 @@ async def bip39_show_and_confirm_mnemonic(ctx, mnemonic: str): await _show_confirmation_failure(ctx, None) -async def bip39_show_backup_warning(ctx): - text = Text("Backup your seed", ui.ICON_NOCOPY) - text.normal( - "Never make a digital", - "copy of your recovery", - "shares and never upload", - "them online!", - ) - await require_confirm( - ctx, text, ButtonRequestType.ResetDevice, confirm="I understand", cancel=None - ) - - async def _bip39_show_mnemonic(ctx, words: list): # split mnemonic words into pages PER_PAGE = const(4) diff --git a/core/src/apps/management/reset_device.py b/core/src/apps/management/reset_device.py index 28e8cacb6..6868fdc80 100644 --- a/core/src/apps/management/reset_device.py +++ b/core/src/apps/management/reset_device.py @@ -75,7 +75,9 @@ async def reset_device(ctx, msg): # if we backed up the wallet, show success message if not msg.no_backup and not msg.skip_backup: - await layout.show_backup_success(ctx) + await layout.show_backup_warning( + ctx, "Backup is done!", "Finish backup", msg.slip39 + ) return Success(message="Initialized")