What changed, and why it matters
This commit is purely a code formatting cleanup. It reorders import statements alphabetically, removes extra blank lines, and fixes indentation and spacing. There are no functional changes to how the Keystone 3 firmware handles cryptocurrency transactions or private keys.
No security action required. Treat as normal code-style maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff shows only cosmetic changes across four Rust source files. In ur.rs and ur_ext.rs, feature-gated use statements are reordered (e.g., tron imports moved after ton imports, zcash imports moved). In general_test_cmd.rs, trailing whitespace is removed and a multi-line constructor call is collapsed to one line. In tron/mod.rs, imports are reordered and indentation/blank-line issues are corrected. No logic, API behavior, or security boundary changes are present.
Changed components
rust/rust_c/src/common/ur.rsrust/rust_c/src/common/ur_ext.rsrust/rust_c/src/test_cmd/general_test_cmd.rsrust/rust_c/src/tron/mod.rsInspect captured patch +13 / −18
diff --git a/rust/rust_c/src/common/ur.rs b/rust/rust_c/src/common/ur.rs
index 92b01ea..08b96b1 100644
--- a/rust/rust_c/src/common/ur.rs
+++ b/rust/rust_c/src/common/ur.rs
@@ -69,12 +69,12 @@ use ur_registry::sui::sui_sign_hash_request::SuiSignHashRequest;
use ur_registry::sui::sui_sign_request::SuiSignRequest;
#[cfg(feature = "ton")]
use ur_registry::ton::ton_sign_request::TonSignRequest;
-#[cfg(feature = "zcash")]
-use ur_registry::zcash::zcash_pczt::ZcashPczt;
#[cfg(feature = "tron")]
use ur_registry::tron::tron_sign_request::TronSignRequest;
#[cfg(feature = "tron")]
use ur_registry::tron::tron_signature::TronSignature;
+#[cfg(feature = "zcash")]
+use ur_registry::zcash::zcash_pczt::ZcashPczt;
use super::errors::{ErrorCodes, RustCError};
use super::free::Free;
diff --git a/rust/rust_c/src/common/ur_ext.rs b/rust/rust_c/src/common/ur_ext.rs
index d825f86..d78f7e0 100644
--- a/rust/rust_c/src/common/ur_ext.rs
+++ b/rust/rust_c/src/common/ur_ext.rs
@@ -55,8 +55,6 @@ use ur_registry::pb::protoc;
use ur_registry::pb::protoc::Base;
#[cfg(feature = "solana")]
use ur_registry::solana::sol_sign_request::SolSignRequest;
-#[cfg(feature = "tron")]
-use ur_registry::tron::tron_sign_request::TronSignRequest;
#[cfg(feature = "stellar")]
use ur_registry::stellar::stellar_sign_request::{SignType as StellarSignType, StellarSignRequest};
#[cfg(feature = "sui")]
@@ -65,6 +63,8 @@ use ur_registry::sui::sui_sign_hash_request::SuiSignHashRequest;
use ur_registry::sui::sui_sign_request::SuiSignRequest;
#[cfg(feature = "ton")]
use ur_registry::ton::ton_sign_request::{DataType, TonSignRequest};
+#[cfg(feature = "tron")]
+use ur_registry::tron::tron_sign_request::TronSignRequest;
#[cfg(feature = "zcash")]
use ur_registry::zcash::zcash_pczt::ZcashPczt;
diff --git a/rust/rust_c/src/test_cmd/general_test_cmd.rs b/rust/rust_c/src/test_cmd/general_test_cmd.rs
index 9d787a9..7958d45 100644
--- a/rust/rust_c/src/test_cmd/general_test_cmd.rs
+++ b/rust/rust_c/src/test_cmd/general_test_cmd.rs
@@ -65,14 +65,10 @@ pub unsafe extern "C" fn test_get_tron_keystone_bytes() -> *mut URParseResult {
#[no_mangle]
pub unsafe extern "C" fn test_get_tron_standard_request_bytes() -> *mut URParseResult {
let hex_str = "a30258d47b2266726f6d223a22545868745972386e6d6769537033645933635366694b426a6564337a4e3874654853222c22746f223a22544b43735874664b6648326436614561514363747962444339756141334d536a3268222c2276616c7565223a2231303030303030227d03d90130a1018a182cf518c3f51800f51800f51800f5";
-
+
let bytes = Bytes::new(hex::decode(hex_str).unwrap());
-
- URParseResult::single(
- ViewType::TronTx,
- QRCodeType::TronSignRequest,
- bytes
- ).c_ptr()
+
+ URParseResult::single(ViewType::TronTx, QRCodeType::TronSignRequest, bytes).c_ptr()
}
#[no_mangle]
diff --git a/rust/rust_c/src/tron/mod.rs b/rust/rust_c/src/tron/mod.rs
index 054adf8..d9d31d7 100644
--- a/rust/rust_c/src/tron/mod.rs
+++ b/rust/rust_c/src/tron/mod.rs
@@ -9,10 +9,10 @@ use crate::common::utils::{convert_c_char, recover_c_char};
use crate::extract_array;
use alloc::boxed::Box;
use alloc::slice;
+use alloc::string::{String, ToString};
+use alloc::vec::Vec;
use cty::c_char;
use structs::DisplayTron;
-use alloc::vec::Vec;
-use alloc::string::{ToString, String};
use crate::extract_ptr_with_type;
use ur_registry::traits::{RegistryItem, To};
@@ -30,7 +30,7 @@ pub unsafe extern "C" fn tron_check_sign_request(
master_fingerprint: PtrBytes,
length: u32,
) -> PtrT<TransactionCheckResult> {
- if length != 4 {
+ if length != 4 {
return TransactionCheckResult::from(RustCError::InvalidMasterFingerprint).c_ptr();
}
let req = extract_ptr_with_type!(ptr, TronSignRequest);
@@ -47,8 +47,8 @@ pub unsafe extern "C" fn tron_check_sign_request(
} else {
return TransactionCheckResult::from(RustCError::InvalidMasterFingerprint).c_ptr();
}
-
- let x_pub_recovered = recover_c_char(x_pub);
+
+ let x_pub_recovered = recover_c_char(x_pub);
let xpub_str = x_pub_recovered.as_str();
let sign_data = req.get_sign_data();
let path = req.get_derivation_path().get_path().unwrap_or_default();
@@ -96,7 +96,7 @@ pub unsafe extern "C" fn tron_sign_request(
let path = req
.get_derivation_path()
.get_path()
- .unwrap_or_else(|| String::from(TRON_DEFAULT_PATH));
+ .unwrap_or_else(|| String::from(TRON_DEFAULT_PATH));
let signed_tx_hex = app_tron::sign_tx_request(&json_bytes, &path, seed_slice)
.map_err(|e| KeystoneError::SignTxFailed(e.to_string()))?;
@@ -120,7 +120,6 @@ pub unsafe extern "C" fn tron_sign_request(
}
}
-
#[no_mangle]
pub unsafe extern "C" fn tron_check_keystone(
ptr: PtrUR,
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.