mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-10 14:42:44 +00:00
fixup! chore(core): update core to reflect cache and context refactor [no changelog]
This commit is contained in:
parent
5d47f486ca
commit
e071e9909b
@ -9,6 +9,7 @@ from trezor import io, log, loop, utils, wire, workflow
|
|||||||
from trezor.messages import ButtonAck, ButtonRequest
|
from trezor.messages import ButtonAck, ButtonRequest
|
||||||
from trezor.wire import context
|
from trezor.wire import context
|
||||||
from trezorui2 import AttachType, BacklightLevels, LayoutState
|
from trezorui2 import AttachType, BacklightLevels, LayoutState
|
||||||
|
from trezor.wire.protocol_common import Context
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Any, Callable, Generator, Generic, Iterator, TypeVar
|
from typing import Any, Callable, Generator, Generic, Iterator, TypeVar
|
||||||
@ -166,7 +167,7 @@ class Layout(Generic[T]):
|
|||||||
self.button_request_ack_pending: bool = False
|
self.button_request_ack_pending: bool = False
|
||||||
self.transition_out: AttachType | None = None
|
self.transition_out: AttachType | None = None
|
||||||
self.backlight_level = BacklightLevels.NORMAL
|
self.backlight_level = BacklightLevels.NORMAL
|
||||||
self.context: context.Context | None = None
|
self.context: Context | None = None
|
||||||
self.state: LayoutState = LayoutState.INITIAL
|
self.state: LayoutState = LayoutState.INITIAL
|
||||||
|
|
||||||
# Indicates whether we should use Resume attach style when launching.
|
# Indicates whether we should use Resume attach style when launching.
|
||||||
@ -217,7 +218,7 @@ class Layout(Generic[T]):
|
|||||||
set_current_layout(self)
|
set_current_layout(self)
|
||||||
|
|
||||||
# save context
|
# save context
|
||||||
self.context = context.CURRENT_CONTEXT
|
self.context = context.get_context()
|
||||||
|
|
||||||
# attach a timer callback and paint self
|
# attach a timer callback and paint self
|
||||||
self._event(self.layout.attach_timer_fn, self._set_timer, transition_in)
|
self._event(self.layout.attach_timer_fn, self._set_timer, transition_in)
|
||||||
|
Loading…
Reference in New Issue
Block a user