mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-22 05:10:56 +00:00
fix(python): protocol_v2 database init
[no changelog]
This commit is contained in:
parent
131c611fce
commit
08c0c94f42
@ -50,7 +50,7 @@ def _get_iv_from_nonce(nonce: int) -> bytes:
|
|||||||
|
|
||||||
class ProtocolV2(ProtocolAndChannel):
|
class ProtocolV2(ProtocolAndChannel):
|
||||||
channel_id: int
|
channel_id: int
|
||||||
|
channel_database: ChannelDatabase
|
||||||
key_request: bytes
|
key_request: bytes
|
||||||
key_response: bytes
|
key_response: bytes
|
||||||
nonce_request: int
|
nonce_request: int
|
||||||
@ -67,6 +67,7 @@ class ProtocolV2(ProtocolAndChannel):
|
|||||||
mapping: ProtobufMapping,
|
mapping: ProtobufMapping,
|
||||||
channel_data: ChannelData | None = None,
|
channel_data: ChannelData | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
self.channel_database: ChannelDatabase = get_channel_db()
|
||||||
super().__init__(transport, mapping, channel_data)
|
super().__init__(transport, mapping, channel_data)
|
||||||
if channel_data is not None:
|
if channel_data is not None:
|
||||||
self.channel_id = channel_data.channel_id
|
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_receive = channel_data.sync_bit_receive
|
||||||
self.sync_bit_send = channel_data.sync_bit_send
|
self.sync_bit_send = channel_data.sync_bit_send
|
||||||
self._has_valid_channel = True
|
self._has_valid_channel = True
|
||||||
self.channel_database: ChannelDatabase = get_channel_db()
|
|
||||||
|
|
||||||
def get_channel(self) -> ProtocolV2:
|
def get_channel(self) -> ProtocolV2:
|
||||||
if not self._has_valid_channel:
|
if not self._has_valid_channel:
|
||||||
|
Loading…
Reference in New Issue
Block a user