]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Check `max_total_routing_fee` is accounted for in `test_threaded_payment_retries`
authorElias Rohrer <dev@tnull.de>
Tue, 26 Sep 2023 08:48:33 +0000 (10:48 +0200)
committerElias Rohrer <dev@tnull.de>
Tue, 26 Sep 2023 18:12:30 +0000 (20:12 +0200)
lightning/src/ln/payment_tests.rs

index 1bd4a8fa91f680caf97db9f2c0631b8cc4cd4354..2833ba8e809aa5f76c49727b2c4512be6dfd8146 100644 (file)
@@ -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()));