@@ -716,7 +716,7 @@ mod test {
716
716
use crate :: ln:: channelmanager:: { Bolt11InvoiceParameters , PhantomRouteHints , MIN_FINAL_CLTV_EXPIRY_DELTA , PaymentId , RecipientOnionFields , Retry } ;
717
717
use crate :: ln:: functional_test_utils:: * ;
718
718
use crate :: ln:: msgs:: ChannelMessageHandler ;
719
- use crate :: routing:: router:: { PaymentParameters , RouteParameters } ;
719
+ use crate :: routing:: router:: { PaymentParameters , RouteParameters , RouteParametersConfig } ;
720
720
use crate :: util:: test_utils;
721
721
use crate :: util:: config:: UserConfig ;
722
722
use std:: collections:: HashSet ;
@@ -750,7 +750,7 @@ mod test {
750
750
751
751
752
752
#[ test]
753
- fn test_from_channelmanager ( ) {
753
+ fn create_and_pay_for_bolt11_invoice ( ) {
754
754
let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
755
755
let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
756
756
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
@@ -784,17 +784,10 @@ mod test {
784
784
assert_eq ! ( invoice. route_hints( ) [ 0 ] . 0 [ 0 ] . htlc_minimum_msat, chan. inbound_htlc_minimum_msat) ;
785
785
assert_eq ! ( invoice. route_hints( ) [ 0 ] . 0 [ 0 ] . htlc_maximum_msat, chan. inbound_htlc_maximum_msat) ;
786
786
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 ( ) ) ;
793
787
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, PaymentId ( [ 42 ; 32 ] ) , None , RouteParametersConfig :: default ( ) ,
790
+ Retry :: Attempts ( 0 ) ) . unwrap ( ) ;
798
791
check_added_monitors ( & nodes[ 0 ] , 1 ) ;
799
792
800
793
let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
0 commit comments