1
0
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:
Jan Pochyla 2019-01-10 14:32:28 +01:00 committed by Pavol Rusnak
parent fbd348ee8e
commit a0c8e977a2
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -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: