@@ -716,7 +716,7 @@ mod test {
716716 use crate :: ln:: channelmanager:: { Bolt11InvoiceParameters , PhantomRouteHints , MIN_FINAL_CLTV_EXPIRY_DELTA , PaymentId , RecipientOnionFields , Retry } ;
717717 use crate :: ln:: functional_test_utils:: * ;
718718 use crate :: ln:: msgs:: ChannelMessageHandler ;
719- use crate :: routing:: router:: { PaymentParameters , RouteParameters } ;
719+ use crate :: routing:: router:: { PaymentParameters , RouteParameters , RouteParametersConfig } ;
720720 use crate :: util:: test_utils;
721721 use crate :: util:: config:: UserConfig ;
722722 use std:: collections:: HashSet ;
@@ -750,7 +750,7 @@ mod test {
750750
751751
752752 #[ test]
753- fn test_from_channelmanager ( ) {
753+ fn create_and_pay_for_bolt11_invoice ( ) {
754754 let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
755755 let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
756756 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
@@ -784,17 +784,10 @@ mod test {
784784 assert_eq ! ( invoice. route_hints( ) [ 0 ] . 0 [ 0 ] . htlc_minimum_msat, chan. inbound_htlc_minimum_msat) ;
785785 assert_eq ! ( invoice. route_hints( ) [ 0 ] . 0 [ 0 ] . htlc_maximum_msat, chan. inbound_htlc_maximum_msat) ;
786786
787- let payment_params = PaymentParameters :: from_node_id ( invoice. recover_payee_pub_key ( ) ,
788- invoice. min_final_cltv_expiry_delta ( ) as u32 )
789- . with_bolt11_features ( invoice. features ( ) . unwrap ( ) . clone ( ) ) . unwrap ( )
790- . with_route_hints ( invoice. route_hints ( ) ) . unwrap ( ) ;
791- let route_params = RouteParameters :: from_payment_params_and_value (
792- payment_params, invoice. amount_milli_satoshis ( ) . unwrap ( ) ) ;
793787 let payment_event = {
794- let payment_hash = PaymentHash ( invoice. payment_hash ( ) . to_byte_array ( ) ) ;
795- nodes[ 0 ] . node . send_payment ( payment_hash,
796- RecipientOnionFields :: secret_only ( * invoice. payment_secret ( ) ) ,
797- PaymentId ( payment_hash. 0 ) , route_params, Retry :: Attempts ( 0 ) ) . unwrap ( ) ;
788+ nodes[ 0 ] . node . pay_for_bolt11_invoice (
789+ & invoice, None , RouteParametersConfig :: default ( ) ,
790+ Retry :: Attempts ( 0 ) ) . unwrap ( ) ;
798791 check_added_monitors ( & nodes[ 0 ] , 1 ) ;
799792
800793 let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
0 commit comments