From 7bf2f9f2dabcbde83d7e1f0ed2a5b65a3fab3844 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Fri, 22 Nov 2024 10:10:14 +0100 Subject: [PATCH] fix(python): protocol_v2 database init [no changelog] --- python/src/trezorlib/transport/thp/protocol_v2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/src/trezorlib/transport/thp/protocol_v2.py b/python/src/trezorlib/transport/thp/protocol_v2.py index f99021a29c..07ff2cadd4 100644 --- a/python/src/trezorlib/transport/thp/protocol_v2.py +++ b/python/src/trezorlib/transport/thp/protocol_v2.py @@ -50,7 +50,7 @@ def _get_iv_from_nonce(nonce: int) -> bytes: class ProtocolV2(ProtocolAndChannel): channel_id: int - + channel_database: ChannelDatabase key_request: bytes key_response: bytes nonce_request: int @@ -67,6 +67,7 @@ class ProtocolV2(ProtocolAndChannel): mapping: ProtobufMapping, channel_data: ChannelData | None = None, ) -> None: + self.channel_database: ChannelDatabase = get_channel_db() super().__init__(transport, mapping, channel_data) if channel_data is not None: self.channel_id = channel_data.channel_id @@ -77,7 +78,6 @@ class ProtocolV2(ProtocolAndChannel): self.sync_bit_receive = channel_data.sync_bit_receive self.sync_bit_send = channel_data.sync_bit_send self._has_valid_channel = True - self.channel_database: ChannelDatabase = get_channel_db() def get_channel(self) -> ProtocolV2: if not self._has_valid_channel: