From 936fe1aea94f5b5e992ccc0896db70e8ffaf44c8 Mon Sep 17 00:00:00 2001 From: obrusvit Date: Sun, 2 Jun 2024 16:24:32 +0200 Subject: [PATCH] feat(core/ui): T3T1 separate wallet created screen Commit adds separate call of success screen after wallet is created. This is to ensure the success is shown even when skip_backup is set in the protob msg. [no changelog] --- core/src/apps/management/reset_device/__init__.py | 9 ++++++++- core/src/trezor/ui/layouts/mercury/__init__.py | 9 ++++----- core/src/trezor/ui/layouts/tr/__init__.py | 5 +++++ core/src/trezor/ui/layouts/tt/__init__.py | 5 +++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/core/src/apps/management/reset_device/__init__.py b/core/src/apps/management/reset_device/__init__.py index a37804672f..4cf51a3db0 100644 --- a/core/src/apps/management/reset_device/__init__.py +++ b/core/src/apps/management/reset_device/__init__.py @@ -33,7 +33,11 @@ async def reset_device(msg: ResetDevice) -> Success: from trezor.crypto import bip39, random from trezor.messages import EntropyAck, EntropyRequest, Success from trezor.pin import render_empty_loader - from trezor.ui.layouts import confirm_reset_device, prompt_backup + from trezor.ui.layouts import ( + confirm_reset_device, + prompt_backup, + show_wallet_created_success, + ) from trezor.wire.context import call from apps.common.request_pin import request_pin_confirm @@ -93,6 +97,9 @@ async def reset_device(msg: ResetDevice) -> Success: # Otherwise, we try to do it. perform_backup = not msg.no_backup and not msg.skip_backup + # Wallet created successfully + await show_wallet_created_success() + # If doing backup, ask the user to confirm. if perform_backup: perform_backup = await prompt_backup() diff --git a/core/src/trezor/ui/layouts/mercury/__init__.py b/core/src/trezor/ui/layouts/mercury/__init__.py index 3d85acff81..5a8becf00e 100644 --- a/core/src/trezor/ui/layouts/mercury/__init__.py +++ b/core/src/trezor/ui/layouts/mercury/__init__.py @@ -366,18 +366,17 @@ async def confirm_reset_device(_title: str, recovery: bool = False) -> None: ) -async def prompt_backup() -> bool: - # TODO: should we move this to `flow_prompt_backup`? +async def show_wallet_created_success() -> None: await interact( RustLayout( - trezorui2.show_success( - title=TR.backup__new_wallet_created, description=None - ) + trezorui2.show_success(title=TR.backup__new_wallet_created, description="") ), "backup_device", ButtonRequestType.ResetDevice, ) + +async def prompt_backup() -> bool: result = await interact( RustLayout(trezorui2.flow_prompt_backup()), "backup_device", diff --git a/core/src/trezor/ui/layouts/tr/__init__.py b/core/src/trezor/ui/layouts/tr/__init__.py index edebfa046e..b27b319305 100644 --- a/core/src/trezor/ui/layouts/tr/__init__.py +++ b/core/src/trezor/ui/layouts/tr/__init__.py @@ -465,6 +465,11 @@ def confirm_reset_device( ) +async def show_wallet_created_success() -> None: + # not shown on model R + return None + + async def prompt_backup() -> bool: br_type = "backup_device" br_code = ButtonRequestType.ResetDevice diff --git a/core/src/trezor/ui/layouts/tt/__init__.py b/core/src/trezor/ui/layouts/tt/__init__.py index 48fef1b043..0a010c59d3 100644 --- a/core/src/trezor/ui/layouts/tt/__init__.py +++ b/core/src/trezor/ui/layouts/tt/__init__.py @@ -383,6 +383,11 @@ def confirm_reset_device(title: str, recovery: bool = False) -> Awaitable[None]: ) +async def show_wallet_created_success() -> None: + # not shown on model T + return None + + # TODO cleanup @ redesign async def prompt_backup() -> bool: result = await interact(