From b5e142307b5698f666796e3628d1a97ad48d3f81 Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Wed, 21 Feb 2018 15:04:49 +0100 Subject: [PATCH] src/apps/common: store debug signals in cache Prevents unloading through unimport. --- src/apps/common/cache.py | 4 +++- src/apps/common/confirm.py | 3 ++- src/apps/common/request_words.py | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/apps/common/cache.py b/src/apps/common/cache.py index c11aa0dac..cdb184f4f 100644 --- a/src/apps/common/cache.py +++ b/src/apps/common/cache.py @@ -1,4 +1,6 @@ -_seed, _state = None, None +memory = {} +_seed = None +_state = None def get_state(): diff --git a/src/apps/common/confirm.py b/src/apps/common/confirm.py index 09cb01b89..deb7b1628 100644 --- a/src/apps/common/confirm.py +++ b/src/apps/common/confirm.py @@ -1,9 +1,10 @@ from trezor import wire, ui, loop +from apps.common import cache # used to confirm/cancel the dialogs from outside of this module (i.e. # through debug link) if __debug__: - signal = loop.signal() + signal = cache.memory.setdefault('confirm_signal', loop.signal()) @ui.layout diff --git a/src/apps/common/request_words.py b/src/apps/common/request_words.py index 2d06049ec..59c1eba61 100644 --- a/src/apps/common/request_words.py +++ b/src/apps/common/request_words.py @@ -1,9 +1,10 @@ from trezor import wire, ui, loop +from apps.common import cache # used to confirm/cancel the dialogs from outside of this module (i.e. # through debug link) if __debug__: - signal = loop.signal() + signal = cache.memory.setdefault('request_words_signal', loop.signal()) @ui.layout