bitbox02_rust/ui: inline verify_total_fee
What changed, and why it matters
This commit is a simple internal code cleanup: it removes a thin wrapper function and calls the underlying UI confirmation directly. There is no visible change in behavior, no bug fix, and no security-relevant change.
No security action needed; treat as ordinary refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch inlines transaction::verify_total_fee into BitBox02Ui::verify_total_fee. The removed wrapper only mapped bitbox02::ui::confirm_transaction_fee’s ConfirmResponse to Result<(), UserAbort>. The inlining site performs the exact same mapping. No logic, error handling, or trust boundary changes.
Changed components
src/rust/bitbox02-rust/src/hal/bitbox02/ui.rssrc/rust/bitbox02-rust/src/workflow/transaction.rsInspect captured patch +4 / −8
diff --git a/src/rust/bitbox02-rust/src/hal/bitbox02/ui.rs b/src/rust/bitbox02-rust/src/hal/bitbox02/ui.rs
index 33b5e50..a652976 100644
--- a/src/rust/bitbox02-rust/src/hal/bitbox02/ui.rs
+++ b/src/rust/bitbox02-rust/src/hal/bitbox02/ui.rs
@@ -38,7 +38,10 @@ impl Ui for BitBox02Ui {
fee: &str,
longtouch: bool,
) -> Result<(), transaction::UserAbort> {
- transaction::verify_total_fee(total, fee, longtouch).await
+ match bitbox02::ui::confirm_transaction_fee(total, fee, longtouch).await {
+ bitbox02::ui::ConfirmResponse::Approved => Ok(()),
+ bitbox02::ui::ConfirmResponse::Cancelled => Err(transaction::UserAbort),
+ }
}
#[inline(always)]
diff --git a/src/rust/bitbox02-rust/src/workflow/transaction.rs b/src/rust/bitbox02-rust/src/workflow/transaction.rs
index ed87f56..9ee3127 100644
--- a/src/rust/bitbox02-rust/src/workflow/transaction.rs
+++ b/src/rust/bitbox02-rust/src/workflow/transaction.rs
@@ -11,13 +11,6 @@ fn format_percentage(p: f64) -> String {
util::decimal::format_no_trim(int, 1)
}
-pub async fn verify_total_fee(total: &str, fee: &str, longtouch: bool) -> Result<(), UserAbort> {
- match bitbox02::ui::confirm_transaction_fee(total, fee, longtouch).await {
- bitbox02::ui::ConfirmResponse::Approved => Ok(()),
- bitbox02::ui::ConfirmResponse::Cancelled => Err(UserAbort),
- }
-}
-
pub async fn verify_total_fee_maybe_warn(
hal: &mut impl crate::hal::Hal,
total: &str,
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.