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