diff --git a/core/src/apps/common/sdcard.py b/core/src/apps/common/sdcard.py index 440eeda9f8..dda680a397 100644 --- a/core/src/apps/common/sdcard.py +++ b/core/src/apps/common/sdcard.py @@ -5,7 +5,7 @@ from trezor.ui.layouts import confirm_action, show_error_and_raise from trezor.utils import sd_hotswap_enabled if TYPE_CHECKING: - from trezor.ui.layouts.common import ProgressLayout + from trezor.ui import ProgressLayout class SdCardUnavailable(wire.ProcessError): diff --git a/core/src/apps/debug/__init__.py b/core/src/apps/debug/__init__.py index 66b9b3507d..382411e9bb 100644 --- a/core/src/apps/debug/__init__.py +++ b/core/src/apps/debug/__init__.py @@ -255,7 +255,8 @@ if __debug__: # just updated itself. The update is already live for the caller to retrieve. def _state( - thp_pairing_secret: bytes | None, thp_pairing_code_entry_code: int | None + thp_pairing_secret: bytes | None = None, + thp_pairing_code_entry_code: int | None = None, ) -> DebugLinkState: from trezor.messages import DebugLinkState @@ -284,7 +285,7 @@ if __debug__: ) -> DebugLinkState | None: thp_pairing_secret: bytes | None = None - thp_pairing_code_entry_code: bytes | None = None + thp_pairing_code_entry_code: int | None = None if utils.USE_THP and msg.thp_channel_id is not None: channel_id = int.from_bytes(msg.thp_channel_id, "big") diff --git a/core/src/apps/thp/pairing.py b/core/src/apps/thp/pairing.py index 62207802b8..ddc2be628f 100644 --- a/core/src/apps/thp/pairing.py +++ b/core/src/apps/thp/pairing.py @@ -150,6 +150,7 @@ async def show_display_data(ctx: PairingContext, expected_types: Container[int] return result + @check_state_and_log(ChannelState.TP1) async def _handle_code_entry_is_included(ctx: PairingContext) -> None: commitment = sha256(ctx.secret).digest() diff --git a/core/src/trezor/wire/thp/pairing_context.py b/core/src/trezor/wire/thp/pairing_context.py index 1adde4ca84..bfced1461a 100644 --- a/core/src/trezor/wire/thp/pairing_context.py +++ b/core/src/trezor/wire/thp/pairing_context.py @@ -11,6 +11,7 @@ from trezor.wire.protocol_common import Context, Message if TYPE_CHECKING: from typing import Container + from trezor import ui from .channel import Channel