1010
1111use ldk_node:: config:: { Config , EsploraSyncConfig } ;
1212use ldk_node:: io:: sqlite_store:: SqliteStore ;
13- use ldk_node:: payment:: { PaymentDirection , PaymentKind , PaymentStatus } ;
13+ use ldk_node:: payment:: { Bolt11InvoiceStringDescription , PaymentDirection , PaymentKind , PaymentStatus } ;
1414use ldk_node:: {
1515 Builder , CustomTlvRecord , Event , LightningBalance , LogLevel , Node , NodeError ,
1616 PendingSweepBalance ,
@@ -555,8 +555,10 @@ pub(crate) fn do_channel_full_cycle<E: ElectrumApi>(
555555 let invoice_amount_1_msat = 2500_000 ;
556556 let invoice_description: Bolt11InvoiceDescription =
557557 Bolt11InvoiceDescription :: Direct ( Description :: new ( String :: from ( "asdf" ) ) . unwrap ( ) ) ;
558- let invoice =
559- node_b. bolt11_payment ( ) . receive ( invoice_amount_1_msat, & invoice_description, 9217 ) . unwrap ( ) ;
558+ let invoice = node_b
559+ . bolt11_payment ( )
560+ . receive ( invoice_amount_1_msat, & invoice_description. clone ( ) . into ( ) , 9217 )
561+ . unwrap ( ) ;
560562
561563 println ! ( "\n A send" ) ;
562564 let payment_id = node_a. bolt11_payment ( ) . send ( & invoice, None ) . unwrap ( ) ;
@@ -603,7 +605,7 @@ pub(crate) fn do_channel_full_cycle<E: ElectrumApi>(
603605 // Test under-/overpayment
604606 let invoice_amount_2_msat = 2500_000 ;
605607 let invoice =
606- node_b. bolt11_payment ( ) . receive ( invoice_amount_2_msat, & invoice_description, 9217 ) . unwrap ( ) ;
608+ node_b. bolt11_payment ( ) . receive ( invoice_amount_2_msat, & invoice_description. clone ( ) . into ( ) , 9217 ) . unwrap ( ) ;
607609
608610 let underpaid_amount = invoice_amount_2_msat - 1 ;
609611 assert_eq ! (
@@ -613,7 +615,7 @@ pub(crate) fn do_channel_full_cycle<E: ElectrumApi>(
613615
614616 println ! ( "\n B overpaid receive" ) ;
615617 let invoice =
616- node_b. bolt11_payment ( ) . receive ( invoice_amount_2_msat, & invoice_description, 9217 ) . unwrap ( ) ;
618+ node_b. bolt11_payment ( ) . receive ( invoice_amount_2_msat, & invoice_description. clone ( ) . into ( ) , 9217 ) . unwrap ( ) ;
617619 let overpaid_amount_msat = invoice_amount_2_msat + 100 ;
618620
619621 println ! ( "\n A overpaid send" ) ;
@@ -643,7 +645,7 @@ pub(crate) fn do_channel_full_cycle<E: ElectrumApi>(
643645 // Test "zero-amount" invoice payment
644646 println ! ( "\n B receive_variable_amount_payment" ) ;
645647 let variable_amount_invoice =
646- node_b. bolt11_payment ( ) . receive_variable_amount ( & invoice_description, 9217 ) . unwrap ( ) ;
648+ node_b. bolt11_payment ( ) . receive_variable_amount ( & invoice_description. clone ( ) . into ( ) , 9217 ) . unwrap ( ) ;
647649 let determined_amount_msat = 2345_678 ;
648650 assert_eq ! (
649651 Err ( NodeError :: InvalidInvoice ) ,
@@ -682,7 +684,7 @@ pub(crate) fn do_channel_full_cycle<E: ElectrumApi>(
682684 let manual_payment_hash = PaymentHash ( Sha256 :: hash ( & manual_preimage. 0 ) . to_byte_array ( ) ) ;
683685 let manual_invoice = node_b
684686 . bolt11_payment ( )
685- . receive_for_hash ( invoice_amount_3_msat, & invoice_description, 9217 , manual_payment_hash)
687+ . receive_for_hash ( invoice_amount_3_msat, & invoice_description. clone ( ) . into ( ) , 9217 , manual_payment_hash)
686688 . unwrap ( ) ;
687689 let manual_payment_id = node_a. bolt11_payment ( ) . send ( & manual_invoice, None ) . unwrap ( ) ;
688690
@@ -722,7 +724,7 @@ pub(crate) fn do_channel_full_cycle<E: ElectrumApi>(
722724 . bolt11_payment ( )
723725 . receive_for_hash (
724726 invoice_amount_3_msat,
725- & invoice_description,
727+ & invoice_description. into ( ) ,
726728 9217 ,
727729 manual_fail_payment_hash,
728730 )
0 commit comments