@@ -79,14 +79,11 @@ fn test_priv_forwarding_rejection() {
7979 let ( route, our_payment_hash, our_payment_preimage, our_payment_secret) =
8080 get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params, 10_000 ) ;
8181
82+ let onion = RecipientOnionFields :: secret_only ( our_payment_secret) ;
83+ let id = PaymentId ( our_payment_hash. 0 ) ;
8284 nodes[ 0 ]
8385 . node
84- . send_payment_with_route (
85- route. clone ( ) ,
86- our_payment_hash,
87- RecipientOnionFields :: secret_only ( our_payment_secret) ,
88- PaymentId ( our_payment_hash. 0 ) ,
89- )
86+ . send_payment_with_route ( route. clone ( ) , our_payment_hash, onion, id)
9087 . unwrap ( ) ;
9188 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
9289 let payment_event =
@@ -199,15 +196,9 @@ fn test_priv_forwarding_rejection() {
199196 get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendChannelUpdate , node_c_id) ;
200197 get_event_msg ! ( nodes[ 2 ] , MessageSendEvent :: SendChannelUpdate , node_b_id) ;
201198
202- nodes[ 0 ]
203- . node
204- . send_payment_with_route (
205- route,
206- our_payment_hash,
207- RecipientOnionFields :: secret_only ( our_payment_secret) ,
208- PaymentId ( our_payment_hash. 0 ) ,
209- )
210- . unwrap ( ) ;
199+ let onion = RecipientOnionFields :: secret_only ( our_payment_secret) ;
200+ let id = PaymentId ( our_payment_hash. 0 ) ;
201+ nodes[ 0 ] . node . send_payment_with_route ( route, our_payment_hash, onion, id) . unwrap ( ) ;
211202 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
212203 pass_along_route (
213204 & nodes[ 0 ] ,
@@ -388,15 +379,10 @@ fn test_routed_scid_alias() {
388379 let ( route, payment_hash, payment_preimage, payment_secret) =
389380 get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params, 100_000 ) ;
390381 assert_eq ! ( route. paths[ 0 ] . hops[ 1 ] . short_channel_id, last_hop[ 0 ] . inbound_scid_alias. unwrap( ) ) ;
391- nodes[ 0 ]
392- . node
393- . send_payment_with_route (
394- route,
395- payment_hash,
396- RecipientOnionFields :: secret_only ( payment_secret) ,
397- PaymentId ( payment_hash. 0 ) ,
398- )
399- . unwrap ( ) ;
382+
383+ let onion = RecipientOnionFields :: secret_only ( payment_secret) ;
384+ let id = PaymentId ( payment_hash. 0 ) ;
385+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash, onion, id) . unwrap ( ) ;
400386 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
401387
402388 pass_along_route ( & nodes[ 0 ] , & [ & [ & nodes[ 1 ] , & nodes[ 2 ] ] ] , 100_000 , payment_hash, payment_secret) ;
@@ -623,15 +609,10 @@ fn test_inbound_scid_privacy() {
623609 let ( route, payment_hash, payment_preimage, payment_secret) =
624610 get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params, 100_000 ) ;
625611 assert_eq ! ( route. paths[ 0 ] . hops[ 1 ] . short_channel_id, last_hop[ 0 ] . inbound_scid_alias. unwrap( ) ) ;
626- nodes[ 0 ]
627- . node
628- . send_payment_with_route (
629- route,
630- payment_hash,
631- RecipientOnionFields :: secret_only ( payment_secret) ,
632- PaymentId ( payment_hash. 0 ) ,
633- )
634- . unwrap ( ) ;
612+
613+ let onion = RecipientOnionFields :: secret_only ( payment_secret) ;
614+ let id = PaymentId ( payment_hash. 0 ) ;
615+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash, onion, id) . unwrap ( ) ;
635616 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
636617
637618 pass_along_route ( & nodes[ 0 ] , & [ & [ & nodes[ 1 ] , & nodes[ 2 ] ] ] , 100_000 , payment_hash, payment_secret) ;
@@ -649,15 +630,10 @@ fn test_inbound_scid_privacy() {
649630 let ( route_2, payment_hash_2, _, payment_secret_2) =
650631 get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params_2, 100_000 ) ;
651632 assert_eq ! ( route_2. paths[ 0 ] . hops[ 1 ] . short_channel_id, last_hop[ 0 ] . short_channel_id. unwrap( ) ) ;
652- nodes[ 0 ]
653- . node
654- . send_payment_with_route (
655- route_2,
656- payment_hash_2,
657- RecipientOnionFields :: secret_only ( payment_secret_2) ,
658- PaymentId ( payment_hash_2. 0 ) ,
659- )
660- . unwrap ( ) ;
633+
634+ let onion = RecipientOnionFields :: secret_only ( payment_secret_2) ;
635+ let id = PaymentId ( payment_hash_2. 0 ) ;
636+ nodes[ 0 ] . node . send_payment_with_route ( route_2, payment_hash_2, onion, id) . unwrap ( ) ;
661637 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
662638
663639 let payment_event = SendEvent :: from_node ( & nodes[ 0 ] ) ;
@@ -751,15 +727,10 @@ fn test_scid_alias_returned() {
751727 route. paths [ 0 ] . hops [ 1 ] . fee_msat = 10_000_000 ; // Overshoot the last channel's value
752728
753729 // Route the HTLC through to the destination.
754- nodes[ 0 ]
755- . node
756- . send_payment_with_route (
757- route. clone ( ) ,
758- payment_hash,
759- RecipientOnionFields :: secret_only ( payment_secret) ,
760- PaymentId ( payment_hash. 0 ) ,
761- )
762- . unwrap ( ) ;
730+ let onion = RecipientOnionFields :: secret_only ( payment_secret) ;
731+ let id = PaymentId ( payment_hash. 0 ) ;
732+ nodes[ 0 ] . node . send_payment_with_route ( route. clone ( ) , payment_hash, onion, id) . unwrap ( ) ;
733+
763734 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
764735 let as_updates = get_htlc_update_msgs ! ( nodes[ 0 ] , node_b_id) ;
765736 nodes[ 1 ] . node . handle_update_add_htlc ( node_a_id, & as_updates. update_add_htlcs [ 0 ] ) ;
@@ -794,15 +765,10 @@ fn test_scid_alias_returned() {
794765 route. paths [ 0 ] . hops [ 0 ] . fee_msat = 0 ; // But set fee paid to the middle hop to 0
795766
796767 // Route the HTLC through to the destination.
797- nodes[ 0 ]
798- . node
799- . send_payment_with_route (
800- route,
801- payment_hash,
802- RecipientOnionFields :: secret_only ( payment_secret) ,
803- PaymentId ( payment_hash. 0 ) ,
804- )
805- . unwrap ( ) ;
768+ let onion = RecipientOnionFields :: secret_only ( payment_secret) ;
769+ let id = PaymentId ( payment_hash. 0 ) ;
770+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash, onion, id) . unwrap ( ) ;
771+
806772 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
807773 let as_updates = get_htlc_update_msgs ! ( nodes[ 0 ] , node_b_id) ;
808774 nodes[ 1 ] . node . handle_update_add_htlc ( node_a_id, & as_updates. update_add_htlcs [ 0 ] ) ;
@@ -1003,15 +969,9 @@ fn test_0conf_channel_with_async_monitor() {
1003969 let ( route, payment_hash, payment_preimage, payment_secret) =
1004970 get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , 1_000_000 ) ;
1005971
1006- nodes[ 0 ]
1007- . node
1008- . send_payment_with_route (
1009- route,
1010- payment_hash,
1011- RecipientOnionFields :: secret_only ( payment_secret) ,
1012- PaymentId ( payment_hash. 0 ) ,
1013- )
1014- . unwrap ( ) ;
972+ let onion = RecipientOnionFields :: secret_only ( payment_secret) ;
973+ let id = PaymentId ( payment_hash. 0 ) ;
974+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash, onion, id) . unwrap ( ) ;
1015975 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1016976
1017977 let as_send = SendEvent :: from_node ( & nodes[ 0 ] ) ;
0 commit comments