@@ -79,14 +79,11 @@ fn test_priv_forwarding_rejection() {
79
79
let ( route, our_payment_hash, our_payment_preimage, our_payment_secret) =
80
80
get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params, 10_000 ) ;
81
81
82
+ let onion = RecipientOnionFields :: secret_only ( our_payment_secret) ;
83
+ let id = PaymentId ( our_payment_hash. 0 ) ;
82
84
nodes[ 0 ]
83
85
. 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)
90
87
. unwrap ( ) ;
91
88
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
92
89
let payment_event =
@@ -199,15 +196,9 @@ fn test_priv_forwarding_rejection() {
199
196
get_event_msg ! ( nodes[ 1 ] , MessageSendEvent :: SendChannelUpdate , node_c_id) ;
200
197
get_event_msg ! ( nodes[ 2 ] , MessageSendEvent :: SendChannelUpdate , node_b_id) ;
201
198
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 ( ) ;
211
202
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
212
203
pass_along_route (
213
204
& nodes[ 0 ] ,
@@ -388,15 +379,10 @@ fn test_routed_scid_alias() {
388
379
let ( route, payment_hash, payment_preimage, payment_secret) =
389
380
get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params, 100_000 ) ;
390
381
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 ( ) ;
400
386
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
401
387
402
388
pass_along_route ( & nodes[ 0 ] , & [ & [ & nodes[ 1 ] , & nodes[ 2 ] ] ] , 100_000 , payment_hash, payment_secret) ;
@@ -623,15 +609,10 @@ fn test_inbound_scid_privacy() {
623
609
let ( route, payment_hash, payment_preimage, payment_secret) =
624
610
get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params, 100_000 ) ;
625
611
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 ( ) ;
635
616
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
636
617
637
618
pass_along_route ( & nodes[ 0 ] , & [ & [ & nodes[ 1 ] , & nodes[ 2 ] ] ] , 100_000 , payment_hash, payment_secret) ;
@@ -649,15 +630,10 @@ fn test_inbound_scid_privacy() {
649
630
let ( route_2, payment_hash_2, _, payment_secret_2) =
650
631
get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params_2, 100_000 ) ;
651
632
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 ( ) ;
661
637
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
662
638
663
639
let payment_event = SendEvent :: from_node ( & nodes[ 0 ] ) ;
@@ -751,15 +727,10 @@ fn test_scid_alias_returned() {
751
727
route. paths [ 0 ] . hops [ 1 ] . fee_msat = 10_000_000 ; // Overshoot the last channel's value
752
728
753
729
// 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
+
763
734
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
764
735
let as_updates = get_htlc_update_msgs ! ( nodes[ 0 ] , node_b_id) ;
765
736
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() {
794
765
route. paths [ 0 ] . hops [ 0 ] . fee_msat = 0 ; // But set fee paid to the middle hop to 0
795
766
796
767
// 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
+
806
772
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
807
773
let as_updates = get_htlc_update_msgs ! ( nodes[ 0 ] , node_b_id) ;
808
774
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() {
1003
969
let ( route, payment_hash, payment_preimage, payment_secret) =
1004
970
get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , 1_000_000 ) ;
1005
971
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 ( ) ;
1015
975
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1016
976
1017
977
let as_send = SendEvent :: from_node ( & nodes[ 0 ] ) ;
0 commit comments