What changed, and why it matters
This is a tiny code cleanup inside a test file. It renames a local variable from `pending` to `pending_resolves` and introduces a helper variable `pending_queries_for_name` to avoid repeating the same lookup expression. There is no change to production code, no security fix, and no behavior change.
No security action needed. Treat as normal non-security test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies only lightning/src/onion_message/dns_resolution.rs in a unit test. It refactors two assertions to bind the intermediate vector once (pending_queries_for_name) rather than calling .iter().next().unwrap().1 twice. This is purely stylistic/test readability and does not alter logic, error handling, or runtime behavior.
Changed components
lightning/src/onion_message/dns_resolution.rs (test code only)Inspect captured patch +9 / −4
diff --git a/lightning/src/onion_message/dns_resolution.rs b/lightning/src/onion_message/dns_resolution.rs
index 1842751..d8ef4a2 100644
--- a/lightning/src/onion_message/dns_resolution.rs
+++ b/lightning/src/onion_message/dns_resolution.rs
@@ -856,7 +856,11 @@ mod tests {
resolver.resolve_name(PaymentId([0; 32]), name.clone(), vec![dest(1)], &keys).unwrap();
let (dns_name, contexts_a) = dns_name_and_contexts(&messages);
resolver.resolve_name(PaymentId([1; 32]), name.clone(), vec![dest(2)], &keys).unwrap();
- assert_eq!(resolver.pending_resolves.lock().unwrap().iter().next().unwrap().1.len(), 2);
+ {
+ let pending_resolves = resolver.pending_resolves.lock().unwrap();
+ let pending_queries_for_name = &pending_resolves.iter().next().unwrap().1;
+ assert_eq!(pending_queries_for_name.len(), 2);
+ }
// A single error over payment 0's reply path fails only its (single-query) resolution.
let err = DNSSECError { name: dns_name, definitely_unresolvable: false };
@@ -864,8 +868,9 @@ mod tests {
assert_eq!(failed, vec![(name, PaymentId([0; 32]))]);
// Payment 1's resolution is still pending.
- let pending = resolver.pending_resolves.lock().unwrap();
- assert_eq!(pending.iter().next().unwrap().1.len(), 1);
- assert_eq!(pending.iter().next().unwrap().1[0].payment_id, PaymentId([1; 32]));
+ let pending_resolves = resolver.pending_resolves.lock().unwrap();
+ let pending_queries_for_name = &pending_resolves.iter().next().unwrap().1;
+ assert_eq!(pending_queries_for_name.len(), 1);
+ assert_eq!(pending_queries_for_name[0].payment_id, PaymentId([1; 32]));
}
}
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.