mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-26 01:18:28 +00:00
seed: show a waiting screen before bip39 derivation
This commit is contained in:
parent
fbd348ee8e
commit
a0c8e977a2
@ -1,5 +1,6 @@
|
||||
from trezor import wire
|
||||
from trezor import ui, wire
|
||||
from trezor.crypto import bip32, bip39
|
||||
from trezor.ui.text import Text
|
||||
|
||||
from apps.common import cache, storage
|
||||
from apps.common.request_passphrase import protect_by_passphrase
|
||||
@ -61,6 +62,7 @@ async def get_keychain(ctx: wire.Context, namespaces: list) -> Keychain:
|
||||
if passphrase is None:
|
||||
passphrase = await protect_by_passphrase(ctx)
|
||||
cache.set_passphrase(passphrase)
|
||||
await layout_waiting_screen()
|
||||
seed = bip39.seed(storage.get_mnemonic(), passphrase)
|
||||
cache.set_seed(seed)
|
||||
|
||||
@ -68,6 +70,13 @@ async def get_keychain(ctx: wire.Context, namespaces: list) -> Keychain:
|
||||
return keychain
|
||||
|
||||
|
||||
@ui.layout
|
||||
async def layout_waiting_screen():
|
||||
text = Text("Deriving seed")
|
||||
text.bold("Please wait...")
|
||||
text.render()
|
||||
|
||||
|
||||
def derive_node_without_passphrase(
|
||||
path: list, curve_name: str = "secp256k1"
|
||||
) -> bip32.HDNode:
|
||||
|
Loading…
Reference in New Issue
Block a user