Drop unused fields from `lightning-transaction-sync` test utils
What changed, and why it matters
This commit removes unused data fields from test-only helper code in the rust-lightning project. It does not change any production code, network behavior, or cryptographic logic. There is no security relevance.
No action required. This is a benign test-only refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch simplifies the TestConfirmableEvent enum and its usage in lightning-transaction-sync/tests/integration_tests.rs by dropping fields that were stored but never used in assertions (BlockHash and u32 from Confirmed, BlockHash and u32 from BestBlockUpdated). The test logic still verifies the same transaction IDs and event ordering. This is a pure test-code cleanup with no functional or security impact.
Changed components
lightning-transaction-sync/tests/integration_tests.rsInspect captured patch +7 / −7
diff --git a/lightning-transaction-sync/tests/integration_tests.rs b/lightning-transaction-sync/tests/integration_tests.rs
index b83d27c..07b190a 100644
--- a/lightning-transaction-sync/tests/integration_tests.rs
+++ b/lightning-transaction-sync/tests/integration_tests.rs
@@ -109,9 +109,9 @@ where
#[derive(Debug)]
enum TestConfirmableEvent {
- Confirmed(Txid, BlockHash, u32),
+ Confirmed(Txid),
Unconfirmed(Txid),
- BestBlockUpdated(BlockHash, u32),
+ BestBlockUpdated,
}
struct TestConfirmable {
@@ -140,7 +140,7 @@ impl Confirm for TestConfirmable {
let block_hash = header.block_hash();
self.confirmed_txs.lock().unwrap().insert(txid, (block_hash, height));
self.unconfirmed_txs.lock().unwrap().remove(&txid);
- let event = TestConfirmableEvent::Confirmed(txid, block_hash, height);
+ let event = TestConfirmableEvent::Confirmed(txid);
self.events.lock().unwrap().push(event);
}
}
@@ -154,7 +154,7 @@ impl Confirm for TestConfirmable {
fn best_block_updated(&self, header: &Header, height: u32) {
let block_hash = header.block_hash();
*self.best_block.lock().unwrap() = (block_hash, height);
- let event = TestConfirmableEvent::BestBlockUpdated(block_hash, height);
+ let event = TestConfirmableEvent::BestBlockUpdated;
self.events.lock().unwrap().push(event);
}
@@ -281,12 +281,12 @@ macro_rules! test_syncing {
}
match events[2] {
- TestConfirmableEvent::BestBlockUpdated(..) => {},
+ TestConfirmableEvent::BestBlockUpdated => {},
_ => panic!("Unexpected event"),
}
match events[3] {
- TestConfirmableEvent::Confirmed(t, _, _) => {
+ TestConfirmableEvent::Confirmed(t) => {
assert!(t == txid || t == second_txid);
assert!(seen_txids.remove(&t));
},
@@ -294,7 +294,7 @@ macro_rules! test_syncing {
}
match events[4] {
- TestConfirmableEvent::Confirmed(t, _, _) => {
+ TestConfirmableEvent::Confirmed(t) => {
assert!(t == txid || t == second_txid);
assert!(seen_txids.remove(&t));
},
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.