1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-27 08:38:07 +00:00

core/debug: fail if wait_layout is sent without watch_layout

This commit is contained in:
matejcik 2020-07-28 14:40:36 +02:00 committed by matejcik
parent f71958b63f
commit c008600d08

View File

@ -37,7 +37,7 @@ if __debug__:
debuglink_decision_chan = loop.chan()
layout_change_chan = loop.chan()
current_content = None # type: Optional[List[str]]
current_content = [] # type: List[str]
watch_layout_changes = False
def screenshot() -> bool:
@ -117,7 +117,9 @@ if __debug__:
m.passphrase_protection = passphrase.is_enabled()
m.reset_entropy = reset_internal_entropy
if msg.wait_layout or current_content is None:
if msg.wait_layout:
if not watch_layout_changes:
raise wire.ProcessError("Layout is not watched")
m.layout_lines = await layout_change_chan.take()
else:
m.layout_lines = current_content