p2p: Use `primitives` in `bip152` tests
What changed, and why it matters
This is a minor internal code cleanup in the test suite only. It changes which internal Rust module provides certain Bitcoin data types used in tests, with no functional change to the library or any user-facing behavior.
No action required. This change does not affect security and can be treated as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies p2p/src/bip152.rs test imports only. It replaces bitcoin::locktime::absolute and a bitcoin::{…} import with primitives::locktime::absolute and primitives::{…}, while keeping the imported symbols identical. This is part of a refactoring effort (referenced as #5342 and #5411) to use the primitives crate internally. No runtime logic, serialization, or consensus code is changed.
Changed components
p2p/src/bip152.rs (test module imports only)Inspect captured patch +3 / −3
diff --git a/p2p/src/bip152.rs b/p2p/src/bip152.rs
index 448d6014..b9d9fb44 100644
--- a/p2p/src/bip152.rs
+++ b/p2p/src/bip152.rs
@@ -480,13 +480,13 @@ mod test {
use alloc::vec;
use bitcoin::consensus::encode::{deserialize, serialize};
- use bitcoin::locktime::absolute;
use bitcoin::merkle_tree::TxMerkleNode;
- use bitcoin::{
+ use hex::FromHex;
+ use primitives::locktime::absolute;
+ use primitives::{
transaction, Amount, BlockChecked, BlockTime, CompactTarget, OutPoint, ScriptPubKeyBuf,
ScriptSigBuf, Sequence, TxIn, TxOut, Txid, Witness,
};
- use hex::FromHex;
use super::*;
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.