@@ -48,6 +48,7 @@ use lightning::ln::channel::FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE;
4848use lightning:: ln:: channel_state:: ChannelDetails ;
4949use lightning:: ln:: channelmanager:: {
5050 ChainParameters , ChannelManager , ChannelManagerReadArgs , PaymentId , RecentPaymentDetails ,
51+ RecipientOnionFields ,
5152} ;
5253use lightning:: ln:: functional_test_utils:: * ;
5354use lightning:: ln:: inbound_payment:: ExpandedKey ;
@@ -82,7 +83,6 @@ use bitcoin::secp256k1::{self, Message, PublicKey, Scalar, Secp256k1, SecretKey}
8283
8384use lightning:: io:: Cursor ;
8485use std:: cmp:: { self , Ordering } ;
85- use std:: collections:: VecDeque ;
8686use std:: mem;
8787use std:: sync:: atomic;
8888use std:: sync:: { Arc , Mutex } ;
@@ -113,22 +113,14 @@ impl FeeEstimator for FuzzEstimator {
113113 }
114114}
115115
116- struct FuzzRouter {
117- pub next_routes : Mutex < VecDeque < Route > > ,
118- }
116+ struct FuzzRouter { }
119117
120118impl Router for FuzzRouter {
121119 fn find_route (
122120 & self , _payer : & PublicKey , _params : & RouteParameters ,
123121 _first_hops : Option < & [ & ChannelDetails ] > , _inflight_htlcs : InFlightHtlcs ,
124122 ) -> Result < Route , msgs:: LightningError > {
125- if let Some ( route) = self . next_routes . lock ( ) . unwrap ( ) . pop_front ( ) {
126- return Ok ( route) ;
127- }
128- Err ( msgs:: LightningError {
129- err : String :: from ( "Not implemented" ) ,
130- action : msgs:: ErrorAction :: IgnoreError ,
131- } )
123+ unreachable ! ( )
132124 }
133125
134126 fn create_blinded_payment_paths < T : secp256k1:: Signing + secp256k1:: Verification > (
@@ -518,7 +510,7 @@ fn send_payment(
518510 PaymentParameters :: from_node_id ( source. get_our_node_id ( ) , TEST_FINAL_CLTV ) ,
519511 amt,
520512 ) ;
521- source . router . next_routes . lock ( ) . unwrap ( ) . push_back ( Route {
513+ let route = Route {
522514 paths : vec ! [ Path {
523515 hops: vec![ RouteHop {
524516 pubkey: dest. get_our_node_id( ) ,
@@ -532,11 +524,10 @@ fn send_payment(
532524 blinded_tail: None ,
533525 } ] ,
534526 route_params : Some ( route_params. clone ( ) ) ,
535- } ) ;
527+ } ;
536528 let onion = RecipientOnionFields :: secret_only ( payment_secret) ;
537529 let payment_id = PaymentId ( payment_id) ;
538- let res =
539- source. send_payment ( payment_hash, onion, payment_id, route_params, Retry :: Attempts ( 0 ) ) ;
530+ let res = source. send_payment_with_route ( route, payment_hash, onion, payment_id) ;
540531 match res {
541532 Err ( err) => {
542533 panic ! ( "Errored with {:?} on initial payment send" , err) ;
@@ -592,7 +583,7 @@ fn send_hop_payment(
592583 PaymentParameters :: from_node_id ( source. get_our_node_id ( ) , TEST_FINAL_CLTV ) ,
593584 amt,
594585 ) ;
595- source . router . next_routes . lock ( ) . unwrap ( ) . push_back ( Route {
586+ let route = Route {
596587 paths : vec ! [ Path {
597588 hops: vec![
598589 RouteHop {
@@ -617,11 +608,10 @@ fn send_hop_payment(
617608 blinded_tail: None ,
618609 } ] ,
619610 route_params : Some ( route_params. clone ( ) ) ,
620- } ) ;
611+ } ;
621612 let onion = RecipientOnionFields :: secret_only ( payment_secret) ;
622613 let payment_id = PaymentId ( payment_id) ;
623- let res =
624- source. send_payment ( payment_hash, onion, payment_id, route_params, Retry :: Attempts ( 0 ) ) ;
614+ let res = source. send_payment_with_route ( route, payment_hash, onion, payment_id) ;
625615 match res {
626616 Err ( err) => {
627617 panic ! ( "Errored with {:?} on initial payment send" , err) ;
@@ -640,7 +630,7 @@ fn send_hop_payment(
640630pub fn do_test < Out : Output > ( data : & [ u8 ] , underlying_out : Out , anchors : bool ) {
641631 let out = SearchingOutput :: new ( underlying_out) ;
642632 let broadcast = Arc :: new ( TestBroadcaster { } ) ;
643- let router = FuzzRouter { next_routes : Mutex :: new ( VecDeque :: new ( ) ) } ;
633+ let router = FuzzRouter { } ;
644634
645635 macro_rules! make_node {
646636 ( $node_id: expr, $fee_estimator: expr) => { {
0 commit comments