From 78959439537266a0f6aa478b8274bb11e36282db Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Tue, 26 Sep 2023 10:48:33 +0200 Subject: [PATCH] Check `max_total_routing_fee` is accounted for in `test_threaded_payment_retries` --- lightning/src/ln/payment_tests.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lightning/src/ln/payment_tests.rs b/lightning/src/ln/payment_tests.rs index 1bd4a8fa9..2833ba8e8 100644 --- a/lightning/src/ln/payment_tests.rs +++ b/lightning/src/ln/payment_tests.rs @@ -3135,7 +3135,9 @@ fn test_threaded_payment_retries() { let payment_params = PaymentParameters::from_node_id(nodes[1].node.get_our_node_id(), TEST_FINAL_CLTV) .with_expiry_time(payment_expiry_secs as u64) .with_bolt11_features(invoice_features).unwrap(); - let mut route_params = RouteParameters::from_payment_params_and_value(payment_params, amt_msat); + let mut route_params = RouteParameters { + payment_params, final_value_msat: amt_msat, max_total_routing_fee_msat: Some(500_000), + }; let mut route = Route { paths: vec![ @@ -3174,9 +3176,11 @@ fn test_threaded_payment_retries() { maybe_announced_channel: true, }], blinded_tail: None } ], - route_params: Some(RouteParameters::from_payment_params_and_value( - PaymentParameters::from_node_id(nodes[2].node.get_our_node_id(), TEST_FINAL_CLTV), - amt_msat - amt_msat / 1000)), + route_params: Some(RouteParameters { + payment_params: PaymentParameters::from_node_id(nodes[1].node.get_our_node_id(), TEST_FINAL_CLTV), + final_value_msat: amt_msat - amt_msat / 1000, + max_total_routing_fee_msat: Some(500_000), + }), }; nodes[0].router.expect_find_route(route_params.clone(), Ok(route.clone())); @@ -3234,6 +3238,7 @@ fn test_threaded_payment_retries() { let mut new_route_params = route_params.clone(); previously_failed_channels.push(route.paths[0].hops[1].short_channel_id); new_route_params.payment_params.previously_failed_channels = previously_failed_channels.clone(); + new_route_params.max_total_routing_fee_msat.as_mut().map(|m| *m -= 100_000); route.paths[0].hops[1].short_channel_id += 1; nodes[0].router.expect_find_route(new_route_params, Ok(route.clone())); -- 2.39.5