@@ -16,8 +16,8 @@ use chain::channelmonitor::ChannelMonitor;
16
16
use chain:: keysinterface:: { Recipient , KeysInterface } ;
17
17
use ln:: channelmanager:: { ChannelManager , ChannelManagerReadArgs , MIN_CLTV_EXPIRY_DELTA } ;
18
18
use routing:: network_graph:: RoutingFees ;
19
- use routing:: router:: { RouteHint , RouteHintHop } ;
20
- use ln:: features:: InitFeatures ;
19
+ use routing:: router:: { PaymentParameters , RouteHint , RouteHintHop } ;
20
+ use ln:: features:: { InitFeatures , InvoiceFeatures } ;
21
21
use ln:: msgs;
22
22
use ln:: msgs:: { ChannelMessageHandler , RoutingMessageHandler , OptionalField } ;
23
23
use util:: enforcing_trait_impls:: EnforcingSigner ;
@@ -71,7 +71,10 @@ fn test_priv_forwarding_rejection() {
71
71
htlc_maximum_msat: None ,
72
72
} ] ) ;
73
73
let last_hops = vec ! [ route_hint] ;
74
- let ( route, our_payment_hash, our_payment_preimage, our_payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , last_hops, 10_000 , TEST_FINAL_CLTV ) ;
74
+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 2 ] . node . get_our_node_id ( ) )
75
+ . with_features ( InvoiceFeatures :: known ( ) )
76
+ . with_route_hints ( last_hops) ;
77
+ let ( route, our_payment_hash, our_payment_preimage, our_payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params, 10_000 , TEST_FINAL_CLTV ) ;
75
78
76
79
nodes[ 0 ] . node . send_payment ( & route, our_payment_hash, & Some ( our_payment_secret) ) . unwrap ( ) ;
77
80
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
@@ -269,7 +272,10 @@ fn test_routed_scid_alias() {
269
272
htlc_maximum_msat: None ,
270
273
htlc_minimum_msat: None ,
271
274
} ] ) ] ;
272
- let ( route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , hop_hints, 100_000 , 42 ) ;
275
+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 2 ] . node . get_our_node_id ( ) )
276
+ . with_features ( InvoiceFeatures :: known ( ) )
277
+ . with_route_hints ( hop_hints) ;
278
+ let ( route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params, 100_000 , 42 ) ;
273
279
assert_eq ! ( route. paths[ 0 ] [ 1 ] . short_channel_id, last_hop[ 0 ] . inbound_scid_alias. unwrap( ) ) ;
274
280
nodes[ 0 ] . node . send_payment ( & route, payment_hash, & Some ( payment_secret) ) . unwrap ( ) ;
275
281
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
@@ -419,7 +425,10 @@ fn test_inbound_scid_privacy() {
419
425
htlc_maximum_msat: None ,
420
426
htlc_minimum_msat: None ,
421
427
} ] ) ] ;
422
- let ( route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , hop_hints. clone( ) , 100_000 , 42 ) ;
428
+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 2 ] . node . get_our_node_id ( ) )
429
+ . with_features ( InvoiceFeatures :: known ( ) )
430
+ . with_route_hints ( hop_hints. clone ( ) ) ;
431
+ let ( route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params, 100_000 , 42 ) ;
423
432
assert_eq ! ( route. paths[ 0 ] [ 1 ] . short_channel_id, last_hop[ 0 ] . inbound_scid_alias. unwrap( ) ) ;
424
433
nodes[ 0 ] . node . send_payment ( & route, payment_hash, & Some ( payment_secret) ) . unwrap ( ) ;
425
434
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
@@ -431,7 +440,10 @@ fn test_inbound_scid_privacy() {
431
440
// what channel we're talking about.
432
441
hop_hints[ 0 ] . 0 [ 0 ] . short_channel_id = last_hop[ 0 ] . short_channel_id . unwrap ( ) ;
433
442
434
- let ( route_2, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , hop_hints, 100_000 , 42 ) ;
443
+ let payment_params_2 = PaymentParameters :: from_node_id ( nodes[ 2 ] . node . get_our_node_id ( ) )
444
+ . with_features ( InvoiceFeatures :: known ( ) )
445
+ . with_route_hints ( hop_hints) ;
446
+ let ( route_2, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params_2, 100_000 , 42 ) ;
435
447
assert_eq ! ( route_2. paths[ 0 ] [ 1 ] . short_channel_id, last_hop[ 0 ] . short_channel_id. unwrap( ) ) ;
436
448
nodes[ 0 ] . node . send_payment ( & route_2, payment_hash_2, & Some ( payment_secret_2) ) . unwrap ( ) ;
437
449
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
@@ -479,7 +491,10 @@ fn test_scid_alias_returned() {
479
491
htlc_maximum_msat: None ,
480
492
htlc_minimum_msat: None ,
481
493
} ] ) ] ;
482
- let ( mut route, payment_hash, _, payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , hop_hints, 10_000 , 42 ) ;
494
+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 2 ] . node . get_our_node_id ( ) )
495
+ . with_features ( InvoiceFeatures :: known ( ) )
496
+ . with_route_hints ( hop_hints) ;
497
+ let ( mut route, payment_hash, _, payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params, 10_000 , 42 ) ;
483
498
assert_eq ! ( route. paths[ 0 ] [ 1 ] . short_channel_id, nodes[ 2 ] . node. list_usable_channels( ) [ 0 ] . inbound_scid_alias. unwrap( ) ) ;
484
499
485
500
route. paths [ 0 ] [ 1 ] . fee_msat = 10_000_000 ; // Overshoot the last channel's value
0 commit comments