What changed, and why it matters
This commit is a routine build-system and code-formatting fix. It resets cached CMake build options so each build starts from known defaults, makes cbindgen header-generation failures visible instead of silently ignored, runs Rust formatting, and adds a missing import for tests. There is no indication of a security vulnerability being fixed.
No security action required; treat as normal build hygiene. Reviewers may optionally verify that the new default CMake flags match intended release configurations.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff changes five files: (1) build.bat now initializes cmake_parm with explicit default boolean flags instead of an empty string, preventing stale options from prior builds; (2) rust/rust_c/build.rs replaces a map_or_else that silently swallowed cbindgen errors with an expect that panics on failure; (3) rust/apps/bitcoin/src/network.rs adds use alloc::string::ToString in a test module, likely to satisfy a compiler warning/error; (4) rust/apps/bitcoin/src/transactions/mod.rs and rust/rust_c/src/common/keystone.rs are pure cargo fmt reformatting. No cryptographic, transaction parsing, memory-safety, or access-control changes are present.
Changed components
build.batrust/rust_c/build.rsrust/apps/bitcoin/src/network.rsrust/apps/bitcoin/src/transactions/mod.rsrust/rust_c/src/common/keystone.rsInspect captured patch +8 / −14
### build.bat
@@ -51,7 +51,7 @@ IF "%build_language%"=="true" (
popd
)
-SET cmake_parm=
+SET "cmake_parm=-DBUILD_PRODUCTION=false -DBTC_ONLY=false -DCYPHERPUNK=false -DENABLE_SCREEN_SHOT=false -DDEBUG_MEMORY=false"
IF "%build_production%"=="true" SET "cmake_parm=%cmake_parm% -DBUILD_PRODUCTION=true"
IF "%build_btc_only%"=="true" SET "cmake_parm=%cmake_parm% -DBTC_ONLY=true"
IF "%build_cypherpunk%"=="true" SET "cmake_parm=%cmake_parm% -DCYPHERPUNK=true"
@@ -94,4 +94,4 @@ IF "%build_copy%"=="true" (
.\build\simulator.exe
)
-GOTO :EOF
\ No newline at end of file
+GOTO :EOF
### rust/apps/bitcoin/src/network.rs
@@ -189,6 +189,7 @@ impl NetworkT for CustomNewNetwork {
#[cfg(test)]
mod tests {
use super::{is_legacy_utxo_transaction, is_supported_legacy_utxo_transaction};
+ use alloc::string::ToString;
use ur_registry::pb::protoc::sign_transaction::Transaction;
use ur_registry::pb::protoc::{BchTx, BtcTx, DashTx, DogeTx, LtcTx, SignTransaction};
### rust/apps/bitcoin/src/transactions/mod.rs
@@ -2,9 +2,7 @@
///
/// Retained only for BCH, DASH and LTC compatibility. Bitcoin transactions
/// must use PSBT; other legacy UTXO variants are rejected at the product entry.
-#[deprecated(
- note = "raw-protobuf Bitcoin transactions are deprecated; use PSBT for Bitcoin"
-)]
+#[deprecated(note = "raw-protobuf Bitcoin transactions are deprecated; use PSBT for Bitcoin")]
pub mod legacy;
pub mod parsed_tx;
pub mod psbt;
### rust/rust_c/build.rs
@@ -84,14 +84,10 @@ fn main() {
let builder = cbindgen::Builder::new();
- builder
+ let bindings = builder
.with_crate(".")
.with_config(config)
.generate()
- .map_or_else(
- |_| {},
- |bindings| {
- bindings.write_to_file(output_target);
- },
- )
+ .expect("Failed to generate librust_c.h");
+ bindings.write_to_file(output_target);
}
### rust/rust_c/src/common/keystone.rs
@@ -112,8 +112,7 @@ pub unsafe fn build_check_result(
match payload_content {
Some(payload::Content::SignTx(sign_tx_content)) => {
#[cfg(feature = "bitcoin")]
- let is_legacy_utxo =
- app_bitcoin::network::is_legacy_utxo_transaction(&sign_tx_content);
+ let is_legacy_utxo = app_bitcoin::network::is_legacy_utxo_transaction(&sign_tx_content);
#[cfg(feature = "bitcoin")]
let is_supported_legacy_utxo =
app_bitcoin::network::is_supported_legacy_utxo_transaction(&sign_tx_content);Why this scored 13/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.