From ab08223b294752125a81b0dfb6b42c350b340c57 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Thu, 23 Jan 2025 16:24:34 +0100 Subject: [PATCH] fix(core): fix cardano session derivation [no changelog] --- core/src/apps/base.py | 4 ++-- core/src/apps/cardano/seed.py | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/apps/base.py b/core/src/apps/base.py index 86ffd8af01..6f388d6e49 100644 --- a/core/src/apps/base.py +++ b/core/src/apps/base.py @@ -28,7 +28,7 @@ if TYPE_CHECKING: from trezor.wire import Handler, Msg if utils.USE_THP: - from trezor.messages import Failure, ThpCreateNewSession, ThpNewSession + from trezor.messages import Failure, ThpCreateNewSession _SCREENSAVER_IS_ON = False @@ -211,7 +211,7 @@ if utils.USE_THP: async def handle_ThpCreateNewSession( message: ThpCreateNewSession, - ) -> ThpNewSession | Failure: + ) -> Success | Failure: """ Creates a new `ThpSession` based on the provided parameters and returns a `Success` message on success. diff --git a/core/src/apps/cardano/seed.py b/core/src/apps/cardano/seed.py index e4e77825aa..781b29b59f 100644 --- a/core/src/apps/cardano/seed.py +++ b/core/src/apps/cardano/seed.py @@ -8,7 +8,6 @@ from storage.cache_common import ( ) from trezor import utils, wire from trezor.crypto import cardano -from trezor.wire import context from apps.common import mnemonic from apps.common.seed import get_seed @@ -119,7 +118,7 @@ def is_minting_path(path: Bip32Path) -> bool: def derive_and_store_secrets(ctx: Context, passphrase: str) -> None: assert device.is_initialized() - assert context.cache_get_bool(APP_COMMON_DERIVE_CARDANO) + assert ctx.cache.get_bool(APP_COMMON_DERIVE_CARDANO) if not mnemonic.is_bip39(): # nothing to do for SLIP-39, where we can derive the root from the main seed @@ -139,8 +138,8 @@ def derive_and_store_secrets(ctx: Context, passphrase: str) -> None: else: icarus_trezor_secret = icarus_secret - context.cache_set(APP_CARDANO_ICARUS_SECRET, icarus_secret) - context.cache_set(APP_CARDANO_ICARUS_TREZOR_SECRET, icarus_trezor_secret) + ctx.cache.set(APP_CARDANO_ICARUS_SECRET, icarus_secret) + ctx.cache.set(APP_CARDANO_ICARUS_TREZOR_SECRET, icarus_trezor_secret) async def _get_keychain_bip39(derivation_type: CardanoDerivationType) -> Keychain: