@@ -664,13 +664,13 @@ mod test {
664
664
use crate :: { Currency , Description , InvoiceDescription , SignOrCreationError , CreationError } ;
665
665
use bitcoin_hashes:: { Hash , sha256} ;
666
666
use bitcoin_hashes:: sha256:: Hash as Sha256 ;
667
- use lightning:: chain:: keysinterface:: { EntropySource , PhantomKeysManager } ;
667
+ use lightning:: chain:: keysinterface:: PhantomKeysManager ;
668
668
use lightning:: events:: { MessageSendEvent , MessageSendEventsProvider , Event } ;
669
669
use lightning:: ln:: { PaymentPreimage , PaymentHash } ;
670
- use lightning:: ln:: channelmanager:: { PhantomRouteHints , MIN_FINAL_CLTV_EXPIRY_DELTA , PaymentId , RecipientOnionFields } ;
670
+ use lightning:: ln:: channelmanager:: { PhantomRouteHints , MIN_FINAL_CLTV_EXPIRY_DELTA , PaymentId , RecipientOnionFields , Retry } ;
671
671
use lightning:: ln:: functional_test_utils:: * ;
672
672
use lightning:: ln:: msgs:: ChannelMessageHandler ;
673
- use lightning:: routing:: router:: { PaymentParameters , RouteParameters , find_route } ;
673
+ use lightning:: routing:: router:: { PaymentParameters , RouteParameters } ;
674
674
use lightning:: util:: test_utils;
675
675
use lightning:: util:: config:: UserConfig ;
676
676
use crate :: utils:: create_invoice_from_channelmanager_and_duration_since_epoch;
@@ -712,21 +712,12 @@ mod test {
712
712
payment_params,
713
713
final_value_msat : invoice. amount_milli_satoshis ( ) . unwrap ( ) ,
714
714
} ;
715
- let first_hops = nodes[ 0 ] . node . list_usable_channels ( ) ;
716
- let network_graph = & node_cfgs[ 0 ] . network_graph ;
717
- let logger = test_utils:: TestLogger :: new ( ) ;
718
- let scorer = test_utils:: TestScorer :: new ( ) ;
719
- let random_seed_bytes = chanmon_cfgs[ 1 ] . keys_manager . get_secure_random_bytes ( ) ;
720
- let route = find_route (
721
- & nodes[ 0 ] . node . get_our_node_id ( ) , & route_params, network_graph,
722
- Some ( & first_hops. iter ( ) . collect :: < Vec < _ > > ( ) ) , & logger, & scorer, & random_seed_bytes
723
- ) . unwrap ( ) ;
724
-
725
715
let payment_event = {
726
716
let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
727
717
payment_hash. 0 . copy_from_slice ( & invoice. payment_hash ( ) . as_ref ( ) [ 0 ..32 ] ) ;
728
- nodes[ 0 ] . node . send_payment ( & route, payment_hash,
729
- RecipientOnionFields :: secret_only ( * invoice. payment_secret ( ) ) , PaymentId ( payment_hash. 0 ) ) . unwrap ( ) ;
718
+ nodes[ 0 ] . node . send_payment ( payment_hash,
719
+ RecipientOnionFields :: secret_only ( * invoice. payment_secret ( ) ) ,
720
+ PaymentId ( payment_hash. 0 ) , route_params, Retry :: Attempts ( 0 ) ) . unwrap ( ) ;
730
721
let mut added_monitors = nodes[ 0 ] . chain_monitor . added_monitors . lock ( ) . unwrap ( ) ;
731
722
assert_eq ! ( added_monitors. len( ) , 1 ) ;
732
723
added_monitors. clear ( ) ;
@@ -1133,20 +1124,12 @@ mod test {
1133
1124
payment_params,
1134
1125
final_value_msat : invoice. amount_milli_satoshis ( ) . unwrap ( ) ,
1135
1126
} ;
1136
- let first_hops = nodes[ 0 ] . node . list_usable_channels ( ) ;
1137
- let network_graph = & node_cfgs[ 0 ] . network_graph ;
1138
- let logger = test_utils:: TestLogger :: new ( ) ;
1139
- let scorer = test_utils:: TestScorer :: new ( ) ;
1140
- let random_seed_bytes = chanmon_cfgs[ 1 ] . keys_manager . get_secure_random_bytes ( ) ;
1141
- let route = find_route (
1142
- & nodes[ 0 ] . node . get_our_node_id ( ) , & params, network_graph,
1143
- Some ( & first_hops. iter ( ) . collect :: < Vec < _ > > ( ) ) , & logger, & scorer, & random_seed_bytes
1144
- ) . unwrap ( ) ;
1145
1127
let ( payment_event, fwd_idx) = {
1146
1128
let mut payment_hash = PaymentHash ( [ 0 ; 32 ] ) ;
1147
1129
payment_hash. 0 . copy_from_slice ( & invoice. payment_hash ( ) . as_ref ( ) [ 0 ..32 ] ) ;
1148
- nodes[ 0 ] . node . send_payment ( & route, payment_hash,
1149
- RecipientOnionFields :: secret_only ( * invoice. payment_secret ( ) ) , PaymentId ( payment_hash. 0 ) ) . unwrap ( ) ;
1130
+ nodes[ 0 ] . node . send_payment ( payment_hash,
1131
+ RecipientOnionFields :: secret_only ( * invoice. payment_secret ( ) ) ,
1132
+ PaymentId ( payment_hash. 0 ) , params, Retry :: Attempts ( 0 ) ) . unwrap ( ) ;
1150
1133
let mut added_monitors = nodes[ 0 ] . chain_monitor . added_monitors . lock ( ) . unwrap ( ) ;
1151
1134
assert_eq ! ( added_monitors. len( ) , 1 ) ;
1152
1135
added_monitors. clear ( ) ;
@@ -1175,7 +1158,7 @@ mod test {
1175
1158
nodes[ fwd_idx] . node . process_pending_htlc_forwards ( ) ;
1176
1159
1177
1160
let payment_preimage_opt = if user_generated_pmt_hash { None } else { Some ( payment_preimage) } ;
1178
- expect_payment_claimable ! ( & nodes[ fwd_idx] , payment_hash, payment_secret, payment_amt, payment_preimage_opt, route . paths [ 0 ] . last ( ) . unwrap ( ) . pubkey ) ;
1161
+ expect_payment_claimable ! ( & nodes[ fwd_idx] , payment_hash, payment_secret, payment_amt, payment_preimage_opt, invoice . recover_payee_pub_key ( ) ) ;
1179
1162
do_claim_payment_along_route ( & nodes[ 0 ] , & [ & vec ! ( & nodes[ fwd_idx] ) [ ..] ] , false , payment_preimage) ;
1180
1163
let events = nodes[ 0 ] . node . get_and_clear_pending_events ( ) ;
1181
1164
assert_eq ! ( events. len( ) , 2 ) ;
0 commit comments