Skip to content

Commit 60c31cd

Browse files
f expand mpp test coverage
1 parent 42757e7 commit 60c31cd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lightning/src/routing/router.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4396,8 +4396,18 @@ mod tests {
43964396
assert_eq!(route.paths.len(), 3);
43974397
let mut total_amount_paid_msat = 0;
43984398
for path in &route.paths {
4399+
if payment_params.payee.blinded_route_hints().len() != 0 {
4400+
assert!(path.blinded_tail.is_some()) } else { assert!(path.blinded_tail.is_none()) }
43994401
if let Some(bt) = &path.blinded_tail {
44004402
assert_eq!(path.hops.len() + if bt.hops.len() == 1 { 0 } else { 1 }, 2);
4403+
if bt.hops.len() > 1 {
4404+
assert_eq!(path.hops.last().unwrap().pubkey,
4405+
payment_params.payee.blinded_route_hints().iter()
4406+
.find(|(p, _)| p.htlc_maximum_msat == path.final_value_msat())
4407+
.map(|(_, p)| p.introduction_node_id).unwrap());
4408+
} else {
4409+
assert_eq!(path.hops.last().unwrap().pubkey, nodes[2]);
4410+
}
44014411
} else {
44024412
assert_eq!(path.hops.len(), 2);
44034413
assert_eq!(path.hops.last().unwrap().pubkey, nodes[2]);

0 commit comments

Comments
 (0)