1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-05-29 20:28:45 +00:00

chore(eckhart): update trace function for firmware components

This commit is contained in:
Lukas Bielesch 2025-03-19 09:58:16 +01:00 committed by Lukáš Bielesch
parent f1c44d354c
commit 739deedd8f
6 changed files with 24 additions and 19 deletions

View File

@ -105,6 +105,9 @@ impl Component for SelectWordScreen {
impl crate::trace::Trace for SelectWordScreen { impl crate::trace::Trace for SelectWordScreen {
fn trace(&self, t: &mut dyn crate::trace::Tracer) { fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("SelectWordScreen"); t.component("SelectWordScreen");
t.child("Header", &self.header);
t.child("subtitle", &self.description);
t.child("Content", &self.menu);
} }
} }

View File

@ -192,11 +192,11 @@ impl<'a> Component for ShareWordsScreen<'a> {
#[cfg(feature = "ui_debug")] #[cfg(feature = "ui_debug")]
impl<'a> crate::trace::Trace for ShareWordsScreen<'a> { impl<'a> crate::trace::Trace for ShareWordsScreen<'a> {
fn trace(&self, t: &mut dyn crate::trace::Tracer) { fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("TextComponent"); t.component("TextScreen");
self.header.trace(t); t.child("Header", &self.header);
self.content.trace(t); t.child("Content", &self.content);
self.hint.trace(t); t.child("Hint", &self.hint);
self.action_bar.trace(t); t.child("ActionBar", &self.action_bar);
} }
} }

View File

@ -186,19 +186,19 @@ where
T: AllowedTextContent + crate::trace::Trace, T: AllowedTextContent + crate::trace::Trace,
{ {
fn trace(&self, t: &mut dyn crate::trace::Tracer) { fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("TextComponent"); t.component("TextScreen");
if let Some(header) = self.header.as_ref() { if let Some(header) = self.header.as_ref() {
header.trace(t); t.child("Header", header);
} }
if let Some(subtitle) = self.subtitle.as_ref() { if let Some(subtitle) = self.subtitle.as_ref() {
subtitle.trace(t); t.child("subtitle", subtitle);
} }
self.content.trace(t); t.child("Content", &self.content);
if let Some(hint) = self.hint.as_ref() { if let Some(hint) = self.hint.as_ref() {
hint.trace(t); t.child("Hint", hint);
} }
if let Some(ab) = self.action_bar.as_ref() { if let Some(ab) = self.action_bar.as_ref() {
ab.trace(t); t.child("ActionBar", ab);
} }
} }
} }

View File

@ -187,5 +187,7 @@ impl Swipable for VerticalMenuScreen {
impl crate::trace::Trace for VerticalMenuScreen { impl crate::trace::Trace for VerticalMenuScreen {
fn trace(&self, t: &mut dyn crate::trace::Tracer) { fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("VerticalMenuScreen"); t.component("VerticalMenuScreen");
t.child("Header", &self.header);
t.child("Menu", &self.menu);
} }
} }

View File

@ -858,7 +858,7 @@ class DebugUI:
self.debuglink.press_yes() self.debuglink.press_yes()
elif self.debuglink.model is models.T3W1: elif self.debuglink.model is models.T3W1:
layout = self.debuglink.read_layout() layout = self.debuglink.read_layout()
if "TextComponent" in layout.all_components(): if "TextScreen" in layout.all_components():
self.debuglink.click(self.debuglink.screen_buttons.ok()) self.debuglink.click(self.debuglink.screen_buttons.ok())
else: else:
self.debuglink.press_yes() self.debuglink.press_yes()

View File

@ -484,7 +484,7 @@ class InputFlowShowAddressQRCode(InputFlowBase):
# cancel # cancel
self.debug.click(self.debug.screen_buttons.cancel()) self.debug.click(self.debug.screen_buttons.cancel())
# address # address
self.debug.synchronize_at("TextComponent") self.debug.synchronize_at("TextScreen")
self.debug.click(self.debug.screen_buttons.ok()) self.debug.click(self.debug.screen_buttons.ok())
# continue to the app # continue to the app
self.debug.press_yes() self.debug.press_yes()
@ -558,7 +558,7 @@ class InputFlowShowAddressQRCodeCancel(InputFlowBase):
# menu # menu
self.debug.click(self.debug.screen_buttons.vertical_menu_items()[2]) self.debug.click(self.debug.screen_buttons.vertical_menu_items()[2])
# cancel # cancel
self.debug.synchronize_at("TextComponent") self.debug.synchronize_at("TextScreen")
self.debug.click(self.debug.screen_buttons.ok()) self.debug.click(self.debug.screen_buttons.ok())
@ -728,7 +728,7 @@ class InputFlowShowMultisigXPUBs(InputFlowBase):
# menu # menu
assert "VerticalMenu" in self.all_components() assert "VerticalMenu" in self.all_components()
self.debug.click(self.debug.screen_buttons.vertical_menu_items()[1]) self.debug.click(self.debug.screen_buttons.vertical_menu_items()[1])
layout = self.debug.synchronize_at("TextComponent") layout = self.debug.synchronize_at("TextScreen")
# address details # address details
assert "Multisig 2 of 3" in layout.screen_content() assert "Multisig 2 of 3" in layout.screen_content()
assert TR.address_details__derivation_path in layout.screen_content() assert TR.address_details__derivation_path in layout.screen_content()
@ -740,7 +740,7 @@ class InputFlowShowMultisigXPUBs(InputFlowBase):
# cancel # cancel
self.debug.click(self.debug.screen_buttons.cancel()) self.debug.click(self.debug.screen_buttons.cancel())
# address # address
layout = self.debug.synchronize_at("TextComponent") layout = self.debug.synchronize_at("TextScreen")
self.debug.press_yes() self.debug.press_yes()
@ -881,7 +881,7 @@ class InputFlowShowXpubQRCode(InputFlowBase):
# menu # menu
assert "VerticalMenu" in self.all_components() assert "VerticalMenu" in self.all_components()
self.debug.click(self.debug.screen_buttons.vertical_menu_items()[1]) self.debug.click(self.debug.screen_buttons.vertical_menu_items()[1])
layout = self.debug.synchronize_at("TextComponent") layout = self.debug.synchronize_at("TextScreen")
# address details # address details
assert TR.address_details__derivation_path in layout.screen_content() assert TR.address_details__derivation_path in layout.screen_content()
@ -892,7 +892,7 @@ class InputFlowShowXpubQRCode(InputFlowBase):
# cancel # cancel
self.debug.click(self.debug.screen_buttons.cancel()) self.debug.click(self.debug.screen_buttons.cancel())
# address # address
layout = self.debug.synchronize_at("TextComponent") layout = self.debug.synchronize_at("TextScreen")
self.debug.press_yes() self.debug.press_yes()
@ -1241,7 +1241,7 @@ class InputFlowSignTxInformationCancel(InputFlowBase):
yield from sign_tx_go_to_info_eckhart(self.client) yield from sign_tx_go_to_info_eckhart(self.client)
self.debug.click(self.debug.screen_buttons.menu()) self.debug.click(self.debug.screen_buttons.menu())
self.debug.click(self.debug.screen_buttons.vertical_menu_items()[2]) self.debug.click(self.debug.screen_buttons.vertical_menu_items()[2])
self.debug.synchronize_at("TextComponent") self.debug.synchronize_at("TextScreen")
self.debug.click(self.debug.screen_buttons.ok()) self.debug.click(self.debug.screen_buttons.ok())
self.debug.click(self.debug.screen_buttons.ok()) self.debug.click(self.debug.screen_buttons.ok())