From 7d7ffe3b67cb4fce2970034ad4aaa6917a558b85 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Fri, 31 Jan 2020 07:38:23 +0000 Subject: [PATCH] cardano: derive the root and then cache --- core/src/apps/cardano/seed.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/core/src/apps/cardano/seed.py b/core/src/apps/cardano/seed.py index e44570098..d09033c54 100644 --- a/core/src/apps/cardano/seed.py +++ b/core/src/apps/cardano/seed.py @@ -47,14 +47,10 @@ async def get_keychain(ctx: wire.Context) -> Keychain: seed = mnemonic.get_seed(passphrase) root = bip32.from_seed(seed, "ed25519 cardano seed") + # derive the namespaced root node + for i in SEED_NAMESPACE: + root.derive_cardano(i) storage.cache.set(cache.APP_CARDANO_ROOT, root) - # let's not modify the one in the cache - root = root.clone() - - # derive the namespaced root node - for i in SEED_NAMESPACE: - root.derive_cardano(i) - keychain = Keychain(SEED_NAMESPACE, root) return keychain