Include `maybe_announced` field in `RouteHop`
[rust-lightning] / lightning / src / ln / payment_tests.rs
index d88730c22db058f6f39c0a0f140adc3fdc89dfb5..835ad67f1bc458638bf1061cfd56890070a916fa 100644 (file)
@@ -2201,6 +2201,7 @@ fn auto_retry_partial_failure() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: amt_msat / 2,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None },
                        Path { hops: vec![RouteHop {
                                pubkey: nodes[1].node.get_our_node_id(),
@@ -2209,6 +2210,7 @@ fn auto_retry_partial_failure() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: amt_msat / 2,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None },
                ],
                route_params: Some(route_params.clone()),
@@ -2222,6 +2224,7 @@ fn auto_retry_partial_failure() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: amt_msat / 4,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None },
                        Path { hops: vec![RouteHop {
                                pubkey: nodes[1].node.get_our_node_id(),
@@ -2230,6 +2233,7 @@ fn auto_retry_partial_failure() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: amt_msat / 4,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None },
                ],
                route_params: Some(route_params.clone()),
@@ -2243,6 +2247,7 @@ fn auto_retry_partial_failure() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: amt_msat / 4,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None },
                ],
                route_params: Some(route_params.clone()),
@@ -2487,6 +2492,7 @@ fn retry_multi_path_single_failed_payment() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: 10_000,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None },
                        Path { hops: vec![RouteHop {
                                pubkey: nodes[1].node.get_our_node_id(),
@@ -2495,6 +2501,7 @@ fn retry_multi_path_single_failed_payment() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: 100_000_001, // Our default max-HTLC-value is 10% of the channel value, which this is one more than
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None },
                ],
                route_params: Some(route_params.clone()),
@@ -2576,6 +2583,7 @@ fn immediate_retry_on_failure() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: 100_000_001, // Our default max-HTLC-value is 10% of the channel value, which this is one more than
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None },
                ],
                route_params: Some(RouteParameters::from_payment_params_and_value(
@@ -2662,6 +2670,7 @@ fn no_extra_retries_on_back_to_back_fail() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: 0, // nodes[1] will fail the payment as we don't pay its fee
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }, RouteHop {
                                pubkey: nodes[2].node.get_our_node_id(),
                                node_features: nodes[2].node.node_features(),
@@ -2669,6 +2678,7 @@ fn no_extra_retries_on_back_to_back_fail() {
                                channel_features: nodes[2].node.channel_features(),
                                fee_msat: 100_000_000,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None },
                        Path { hops: vec![RouteHop {
                                pubkey: nodes[1].node.get_our_node_id(),
@@ -2677,6 +2687,7 @@ fn no_extra_retries_on_back_to_back_fail() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: 0, // nodes[1] will fail the payment as we don't pay its fee
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }, RouteHop {
                                pubkey: nodes[2].node.get_our_node_id(),
                                node_features: nodes[2].node.node_features(),
@@ -2684,6 +2695,7 @@ fn no_extra_retries_on_back_to_back_fail() {
                                channel_features: nodes[2].node.channel_features(),
                                fee_msat: 100_000_000,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None }
                ],
                route_params: Some(RouteParameters::from_payment_params_and_value(
@@ -2862,6 +2874,7 @@ fn test_simple_partial_retry() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: 0, // nodes[1] will fail the payment as we don't pay its fee
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }, RouteHop {
                                pubkey: nodes[2].node.get_our_node_id(),
                                node_features: nodes[2].node.node_features(),
@@ -2869,6 +2882,7 @@ fn test_simple_partial_retry() {
                                channel_features: nodes[2].node.channel_features(),
                                fee_msat: 100_000_000,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None },
                        Path { hops: vec![RouteHop {
                                pubkey: nodes[1].node.get_our_node_id(),
@@ -2877,6 +2891,7 @@ fn test_simple_partial_retry() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: 100_000,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }, RouteHop {
                                pubkey: nodes[2].node.get_our_node_id(),
                                node_features: nodes[2].node.node_features(),
@@ -2884,6 +2899,7 @@ fn test_simple_partial_retry() {
                                channel_features: nodes[2].node.channel_features(),
                                fee_msat: 100_000_000,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None }
                ],
                route_params: Some(RouteParameters::from_payment_params_and_value(
@@ -3026,6 +3042,7 @@ fn test_threaded_payment_retries() {
                                channel_features: nodes[1].node.channel_features(),
                                fee_msat: 0,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }, RouteHop {
                                pubkey: nodes[3].node.get_our_node_id(),
                                node_features: nodes[2].node.node_features(),
@@ -3033,6 +3050,7 @@ fn test_threaded_payment_retries() {
                                channel_features: nodes[2].node.channel_features(),
                                fee_msat: amt_msat / 1000,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None },
                        Path { hops: vec![RouteHop {
                                pubkey: nodes[2].node.get_our_node_id(),
@@ -3041,6 +3059,7 @@ fn test_threaded_payment_retries() {
                                channel_features: nodes[2].node.channel_features(),
                                fee_msat: 100_000,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }, RouteHop {
                                pubkey: nodes[3].node.get_our_node_id(),
                                node_features: nodes[3].node.node_features(),
@@ -3048,6 +3067,7 @@ fn test_threaded_payment_retries() {
                                channel_features: nodes[3].node.channel_features(),
                                fee_msat: amt_msat - amt_msat / 1000,
                                cltv_expiry_delta: 100,
+                               maybe_announced_channel: true,
                        }], blinded_tail: None }
                ],
                route_params: Some(RouteParameters::from_payment_params_and_value(