chore(core/rust): add missing traces to components

[no changelog]
pull/3186/head
grdddj 11 months ago committed by Jiří Musil
parent 9234db79e9
commit a8d57bf2c4

@ -144,3 +144,17 @@ pub fn paint_overlapping(components: &mut [&mut dyn PaintOverlapping]) {
component.paint_overlapping()
}
}
// DEBUG-ONLY SECTION BELOW
#[cfg(feature = "ui_debug")]
impl<T> crate::trace::Trace for Maybe<T>
where
T: Component + crate::trace::Trace,
{
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("Maybe");
t.child("inner", &self.inner);
t.bool("visible", self.visible);
}
}

@ -103,3 +103,13 @@ impl<const L: usize> TextBox<L> {
}
}
}
// DEBUG-ONLY SECTION BELOW
#[cfg(feature = "ui_debug")]
impl<const L: usize> crate::trace::Trace for TextBox<L> {
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("TextBox");
t.string("text", &self.text);
}
}

@ -232,10 +232,7 @@ where
T: StringType + Clone,
{
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
match self.wordlist_type {
WordlistType::Bip39 => t.component("Bip39Entry"),
WordlistType::Slip39 => t.component("Slip39Entry"),
}
t.component("MnemonicKeyboard"); // unified with TT
t.string("textbox", self.textbox.content());
if self.offer_words {

@ -239,3 +239,13 @@ impl Bip39Input {
}
}
}
// DEBUG-ONLY SECTION BELOW
#[cfg(feature = "ui_debug")]
impl crate::trace::Trace for Bip39Input {
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("Bip39Input");
t.child("textbox", &self.textbox);
}
}

@ -190,8 +190,14 @@ pub enum MnemonicInputMsg {
}
#[cfg(feature = "ui_debug")]
impl<T, U> crate::trace::Trace for MnemonicKeyboard<T, U> {
impl<T, U> crate::trace::Trace for MnemonicKeyboard<T, U>
where
T: MnemonicInput + crate::trace::Trace,
U: AsRef<str>,
{
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("MnemonicKeyboard");
t.child("prompt", &self.prompt);
t.child("input", &self.input);
}
}

@ -266,3 +266,13 @@ impl Slip39Mask {
self.0.count_ones() <= 1
}
}
// DEBUG-ONLY SECTION BELOW
#[cfg(feature = "ui_debug")]
impl crate::trace::Trace for Slip39Input {
fn trace(&self, t: &mut dyn crate::trace::Tracer) {
t.component("Slip39Input");
t.child("textbox", &self.textbox);
}
}

Loading…
Cancel
Save