@@ -2093,6 +2093,7 @@ fn test_trampoline_forward_payload_encoded_as_receive() {
20932093 let bob_carol_scid = nodes[ 1 ] . node ( ) . list_channels ( ) . iter ( ) . find ( |c| c. channel_id == chan_id_bob_carol) . unwrap ( ) . short_channel_id . unwrap ( ) ;
20942094
20952095 let amt_msat = 1000 ;
2096+ let carol_cltv_expiry_delta = 24 + 39 ;
20962097 let ( payment_preimage, payment_hash, _) = get_payment_preimage_hash ( & nodes[ 2 ] , Some ( amt_msat) , None ) ;
20972098
20982099 // We need the session priv to construct an invalid onion packet later.
@@ -2148,7 +2149,7 @@ fn test_trampoline_forward_payload_encoded_as_receive() {
21482149 short_channel_id: bob_carol_scid,
21492150 channel_features: ChannelFeatures :: empty( ) ,
21502151 fee_msat: 0 ,
2151- cltv_expiry_delta: 24 + 39 ,
2152+ cltv_expiry_delta: carol_cltv_expiry_delta ,
21522153 maybe_announced_channel: false ,
21532154 }
21542155 ] ,
@@ -2159,7 +2160,7 @@ fn test_trampoline_forward_payload_encoded_as_receive() {
21592160 pubkey: carol_node_id,
21602161 node_features: Features :: empty( ) ,
21612162 fee_msat: amt_msat,
2162- cltv_expiry_delta: 24 + 39 ,
2163+ cltv_expiry_delta: carol_cltv_expiry_delta ,
21632164 } ,
21642165 ] ,
21652166 hops: carol_blinded_hops,
@@ -2168,7 +2169,10 @@ fn test_trampoline_forward_payload_encoded_as_receive() {
21682169 final_value_msat: amt_msat,
21692170 } )
21702171 } ] ,
2171- route_params : None ,
2172+ route_params : RouteParameters :: from_payment_params_and_value (
2173+ PaymentParameters :: from_node_id ( carol_node_id, carol_cltv_expiry_delta) ,
2174+ amt_msat,
2175+ ) ,
21722176 } ;
21732177
21742178 nodes[ 0 ] . node . send_payment_with_route ( route. clone ( ) , payment_hash, RecipientOnionFields :: spontaneous_empty ( amt_msat) , PaymentId ( payment_hash. 0 ) ) . unwrap ( ) ;
@@ -2279,6 +2283,7 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
22792283 let bob_carol_scid = nodes[ 1 ] . node ( ) . list_channels ( ) . iter ( ) . find ( |c| c. channel_id == chan_id_bob_carol) . unwrap ( ) . short_channel_id . unwrap ( ) ;
22802284
22812285 let amt_msat = 1000 ;
2286+ let carol_cltv_expiry_delta = 104 + 39 ;
22822287 let ( payment_preimage, payment_hash, payment_secret) = get_payment_preimage_hash ( & nodes[ 2 ] , Some ( amt_msat) , None ) ;
22832288
22842289 // Create a 1-hop blinded path for Carol.
@@ -2314,7 +2319,7 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
23142319 short_channel_id: bob_carol_scid,
23152320 channel_features: ChannelFeatures :: empty( ) ,
23162321 fee_msat: 0 ,
2317- cltv_expiry_delta: 104 + 39 ,
2322+ cltv_expiry_delta: carol_cltv_expiry_delta ,
23182323 maybe_announced_channel: false ,
23192324 }
23202325 ] ,
@@ -2325,7 +2330,7 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
23252330 pubkey: carol_node_id,
23262331 node_features: Features :: empty( ) ,
23272332 fee_msat: amt_msat,
2328- cltv_expiry_delta: 104 + 39 ,
2333+ cltv_expiry_delta: carol_cltv_expiry_delta ,
23292334 } ,
23302335 ] ,
23312336 hops: blinded_path. blinded_hops( ) . to_vec( ) ,
@@ -2334,7 +2339,10 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
23342339 final_value_msat: amt_msat,
23352340 } )
23362341 } ] ,
2337- route_params : None ,
2342+ route_params : RouteParameters :: from_payment_params_and_value (
2343+ PaymentParameters :: from_node_id ( carol_node_id, carol_cltv_expiry_delta) ,
2344+ amt_msat,
2345+ ) ,
23382346 } ;
23392347
23402348 nodes[ 0 ] . node . send_payment_with_route ( route. clone ( ) , payment_hash, RecipientOnionFields :: spontaneous_empty ( amt_msat) , PaymentId ( payment_hash. 0 ) ) . unwrap ( ) ;
@@ -2618,7 +2626,13 @@ fn do_test_trampoline_relay(blinded: bool, test_case: TrampolineTestCase) {
26182626 original_amt_msat,
26192627 ) ) ,
26202628 } ] ,
2621- route_params : None ,
2629+ route_params : RouteParameters :: from_payment_params_and_value (
2630+ PaymentParameters :: from_node_id (
2631+ carol_node_id,
2632+ original_trampoline_cltv + excess_final_cltv,
2633+ ) ,
2634+ original_amt_msat,
2635+ ) ,
26222636 } ;
26232637
26242638 nodes[ 0 ]
@@ -2753,6 +2767,7 @@ fn test_trampoline_forward_rejection() {
27532767 let bob_carol_scid = nodes[ 1 ] . node ( ) . list_channels ( ) . iter ( ) . find ( |c| c. channel_id == chan_id_bob_carol) . unwrap ( ) . short_channel_id . unwrap ( ) ;
27542768
27552769 let amt_msat = 1000 ;
2770+ let carol_cltv_expiry_delta = 24 + 24 + 39 ;
27562771 let ( payment_preimage, payment_hash, _) = get_payment_preimage_hash ( & nodes[ 2 ] , Some ( amt_msat) , None ) ;
27572772
27582773 let route = Route {
@@ -2776,7 +2791,7 @@ fn test_trampoline_forward_rejection() {
27762791 short_channel_id: bob_carol_scid,
27772792 channel_features: ChannelFeatures :: empty( ) ,
27782793 fee_msat: 0 ,
2779- cltv_expiry_delta: 24 + 24 + 39 ,
2794+ cltv_expiry_delta: carol_cltv_expiry_delta ,
27802795 maybe_announced_channel: false ,
27812796 }
27822797 ] ,
@@ -2808,7 +2823,10 @@ fn test_trampoline_forward_rejection() {
28082823 final_value_msat: amt_msat,
28092824 } )
28102825 } ] ,
2811- route_params : None ,
2826+ route_params : RouteParameters :: from_payment_params_and_value (
2827+ PaymentParameters :: from_node_id ( carol_node_id, carol_cltv_expiry_delta) ,
2828+ amt_msat,
2829+ ) ,
28122830 } ;
28132831
28142832 nodes[ 0 ] . node . send_payment_with_route ( route. clone ( ) , payment_hash, RecipientOnionFields :: spontaneous_empty ( amt_msat) , PaymentId ( payment_hash. 0 ) ) . unwrap ( ) ;
0 commit comments