bb02_async: compile block_on only in testing
What changed, and why it matters
This is a small code cleanup change. It removes a helper function from production builds and drops a screen-update call that was only meaningful for tests. There is no indication of a security fix or vulnerability.
No security action needed. Treat as routine maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit gates the block_on helper behind the testing feature and removes the bitbox02::ui::screen_process() call inside it. The function is now only compiled for Rust unit tests. The change is a build/scope refactor, not a security patch.
Changed components
src/rust/bitbox02-rust/src/bb02_async.rsInspect captured patch +1 / −1
diff --git a/src/rust/bitbox02-rust/src/bb02_async.rs b/src/rust/bitbox02-rust/src/bb02_async.rs
index c38f455..7c3060c 100644
--- a/src/rust/bitbox02-rust/src/bb02_async.rs
+++ b/src/rust/bitbox02-rust/src/bb02_async.rs
@@ -59,10 +59,10 @@ pub fn option<O>(option: &RefCell<Option<O>>) -> AsyncOption<'_, O> {
}
/// Polls a future until the result is available.
+#[cfg(feature = "testing")]
pub fn block_on<O>(task: impl core::future::Future<Output = O>) -> O {
let mut task: crate::bb02_async::Task<O> = alloc::boxed::Box::pin(task);
loop {
- bitbox02::ui::screen_process();
if let Poll::Ready(result) = spin(&mut task) {
return result;
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.