mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-14 03:30:02 +00:00
fix(core): fix cyclic import of constants
This commit is contained in:
parent
31ad84133c
commit
09164a3563
@ -24,7 +24,12 @@ from .thp_messages import (
|
||||
InitHeader,
|
||||
)
|
||||
from .thp_session import ThpError
|
||||
from .writer import write_payload_to_wire
|
||||
from .writer import (
|
||||
CONT_DATA_OFFSET,
|
||||
INIT_DATA_OFFSET,
|
||||
REPORT_LENGTH,
|
||||
write_payload_to_wire,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from trezorio import WireInterface # pyright:ignore[reportMissingImports]
|
||||
@ -35,12 +40,9 @@ _MOCK_INTERFACE_HID = b"\x00"
|
||||
|
||||
_PUBKEY_LENGTH = const(32)
|
||||
|
||||
INIT_DATA_OFFSET = const(5)
|
||||
CONT_DATA_OFFSET = const(3)
|
||||
|
||||
MESSAGE_TYPE_LENGTH = const(2)
|
||||
|
||||
REPORT_LENGTH = const(64)
|
||||
MAX_PAYLOAD_LEN = const(60000)
|
||||
|
||||
|
||||
|
@ -1,9 +1,13 @@
|
||||
from micropython import const # pyright: ignore[reportMissingModuleSource]
|
||||
from typing import TYPE_CHECKING # pyright: ignore[reportShadowedImports]
|
||||
|
||||
from trezor import io, log, loop, utils
|
||||
from trezor.wire.thp.channel import CONT_DATA_OFFSET, INIT_DATA_OFFSET, REPORT_LENGTH
|
||||
from trezor.wire.thp.thp_messages import InitHeader
|
||||
|
||||
INIT_DATA_OFFSET = const(5)
|
||||
CONT_DATA_OFFSET = const(3)
|
||||
REPORT_LENGTH = const(64)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from trezorio import WireInterface # pyright: ignore[reportMissingImports]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user