mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-04-22 01:59:02 +00:00
fix(core): hide import of ThpMessageType behind THP build flag
This commit is contained in:
parent
579393e42f
commit
e080df922f
@ -3,7 +3,7 @@ from typing import TYPE_CHECKING
|
||||
import storage.device as storage_device
|
||||
from storage.cache_common import APP_COMMON_BUSY_DEADLINE_MS, APP_COMMON_SEED
|
||||
from trezor import TR, config, utils, wire, workflow
|
||||
from trezor.enums import HomescreenFormat, MessageType, ThpMessageType
|
||||
from trezor.enums import HomescreenFormat, MessageType
|
||||
from trezor.messages import Success, UnlockPath
|
||||
from trezor.ui.layouts import confirm_action
|
||||
from trezor.wire import context
|
||||
@ -30,6 +30,9 @@ if TYPE_CHECKING:
|
||||
if utils.USE_THP:
|
||||
from trezor.messages import Failure, ThpCreateNewSession
|
||||
|
||||
if utils.USE_THP:
|
||||
from trezor.enums import ThpMessageType
|
||||
|
||||
|
||||
_SCREENSAVER_IS_ON = False
|
||||
|
||||
|
@ -2,8 +2,12 @@ import utime
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import storage.cache as storage_cache
|
||||
from trezor import log, loop
|
||||
from trezor.enums import MessageType, ThpMessageType
|
||||
from trezor import log, loop, utils
|
||||
from trezor.enums import MessageType
|
||||
|
||||
if utils.USE_THP:
|
||||
from trezor.enums import ThpMessageType
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Callable
|
||||
@ -15,8 +19,6 @@ if __debug__:
|
||||
|
||||
import micropython
|
||||
|
||||
from trezor import utils
|
||||
|
||||
if utils.USE_THP:
|
||||
ALLOW_WHILE_LOCKED = (
|
||||
ThpMessageType.ThpCreateNewSession,
|
||||
|
Loading…
Reference in New Issue
Block a user