mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-18 10:32:02 +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.crypto import bip32, bip39
|
||||||
|
from trezor.ui.text import Text
|
||||||
|
|
||||||
from apps.common import cache, storage
|
from apps.common import cache, storage
|
||||||
from apps.common.request_passphrase import protect_by_passphrase
|
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:
|
if passphrase is None:
|
||||||
passphrase = await protect_by_passphrase(ctx)
|
passphrase = await protect_by_passphrase(ctx)
|
||||||
cache.set_passphrase(passphrase)
|
cache.set_passphrase(passphrase)
|
||||||
|
await layout_waiting_screen()
|
||||||
seed = bip39.seed(storage.get_mnemonic(), passphrase)
|
seed = bip39.seed(storage.get_mnemonic(), passphrase)
|
||||||
cache.set_seed(seed)
|
cache.set_seed(seed)
|
||||||
|
|
||||||
@ -68,6 +70,13 @@ async def get_keychain(ctx: wire.Context, namespaces: list) -> Keychain:
|
|||||||
return 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(
|
def derive_node_without_passphrase(
|
||||||
path: list, curve_name: str = "secp256k1"
|
path: list, curve_name: str = "secp256k1"
|
||||||
) -> bip32.HDNode:
|
) -> bip32.HDNode:
|
||||||
|
Loading…
Reference in New Issue
Block a user