From 09962708d3f7f8aea4e5777a2de35a2169cd00b5 Mon Sep 17 00:00:00 2001 From: matejcik Date: Tue, 12 Nov 2019 17:42:24 +0100 Subject: [PATCH] core: move load_device to the debug app --- core/src/apps/debug/__init__.py | 10 +++++----- core/src/apps/{management => debug}/load_device.py | 0 core/src/apps/management/__init__.py | 3 --- 3 files changed, 5 insertions(+), 8 deletions(-) rename core/src/apps/{management => debug}/load_device.py (100%) diff --git a/core/src/apps/debug/__init__.py b/core/src/apps/debug/__init__.py index 4f8d993a5..4f97c1163 100644 --- a/core/src/apps/debug/__init__.py +++ b/core/src/apps/debug/__init__.py @@ -4,14 +4,12 @@ if not __debug__: halt("debug mode inactive") if __debug__: - from trezor import config, io, log, loop, ui, utils + from trezor import config, io, log, loop, ui, utils, wire from trezor.messages import MessageType, DebugSwipeDirection from trezor.messages.DebugLinkLayout import DebugLinkLayout - from trezor.wire import register if False: from typing import List, Optional - from trezor import wire from trezor.messages.DebugLinkDecision import DebugLinkDecision from trezor.messages.DebugLinkGetState import DebugLinkGetState from trezor.messages.DebugLinkState import DebugLinkState @@ -111,5 +109,7 @@ if __debug__: if not utils.EMULATOR: config.wipe() - register(MessageType.DebugLinkDecision, dispatch_DebugLinkDecision) - register(MessageType.DebugLinkGetState, dispatch_DebugLinkGetState) + wire.register(MessageType.DebugLinkDecision, dispatch_DebugLinkDecision) + wire.register(MessageType.DebugLinkGetState, dispatch_DebugLinkGetState) + + wire.add(MessageType.LoadDevice, __name__, "load_device") diff --git a/core/src/apps/management/load_device.py b/core/src/apps/debug/load_device.py similarity index 100% rename from core/src/apps/management/load_device.py rename to core/src/apps/debug/load_device.py diff --git a/core/src/apps/management/__init__.py b/core/src/apps/management/__init__.py index 3dacf8ad2..d6781fb59 100644 --- a/core/src/apps/management/__init__.py +++ b/core/src/apps/management/__init__.py @@ -3,9 +3,6 @@ from trezor.messages import MessageType def boot() -> None: - # only enable LoadDevice in debug builds - if __debug__: - wire.add(MessageType.LoadDevice, __name__, "load_device") wire.add(MessageType.ResetDevice, __name__, "reset_device") wire.add(MessageType.BackupDevice, __name__, "backup_device") wire.add(MessageType.WipeDevice, __name__, "wipe_device")