@@ -205,12 +205,12 @@ fn extract_invoice_request<'a, 'b, 'c>(
205205 }
206206}
207207
208- fn extract_invoice < ' a , ' b , ' c > ( node : & Node < ' a , ' b , ' c > , message : & OnionMessage ) -> Bolt12Invoice {
208+ fn extract_invoice < ' a , ' b , ' c > ( node : & Node < ' a , ' b , ' c > , message : & OnionMessage ) -> ( Bolt12Invoice , Option < BlindedPath > ) {
209209 match node. onion_messenger . peel_onion_message ( message) {
210- Ok ( PeeledOnion :: Receive ( message, _, _ ) ) => match message {
210+ Ok ( PeeledOnion :: Receive ( message, _, reply_path ) ) => match message {
211211 ParsedOnionMessageContents :: Offers ( offers_message) => match offers_message {
212212 OffersMessage :: InvoiceRequest ( invoice_request) => panic ! ( "Unexpected invoice_request: {:?}" , invoice_request) ,
213- OffersMessage :: Invoice ( invoice) => invoice,
213+ OffersMessage :: Invoice ( invoice) => ( invoice, reply_path ) ,
214214 #[ cfg( async_payments) ]
215215 OffersMessage :: StaticInvoice ( invoice) => panic ! ( "Unexpected static invoice: {:?}" , invoice) ,
216216 OffersMessage :: InvoiceError ( error) => panic ! ( "Unexpected invoice_error: {:?}" , error) ,
@@ -566,7 +566,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
566566 let onion_message = charlie. onion_messenger . next_onion_message_for_peer ( david_id) . unwrap ( ) ;
567567 david. onion_messenger . handle_onion_message ( & charlie_id, & onion_message) ;
568568
569- let invoice = extract_invoice ( david, & onion_message) ;
569+ let ( invoice, _ ) = extract_invoice ( david, & onion_message) ;
570570 assert_eq ! ( invoice. amount_msats( ) , 10_000_000 ) ;
571571 assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
572572 assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
@@ -645,7 +645,7 @@ fn creates_and_pays_for_refund_using_two_hop_blinded_path() {
645645 let onion_message = charlie. onion_messenger . next_onion_message_for_peer ( david_id) . unwrap ( ) ;
646646 david. onion_messenger . handle_onion_message ( & charlie_id, & onion_message) ;
647647
648- let invoice = extract_invoice ( david, & onion_message) ;
648+ let ( invoice, _ ) = extract_invoice ( david, & onion_message) ;
649649 assert_eq ! ( invoice, expected_invoice) ;
650650
651651 assert_eq ! ( invoice. amount_msats( ) , 10_000_000 ) ;
@@ -712,7 +712,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
712712 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
713713 bob. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
714714
715- let invoice = extract_invoice ( bob, & onion_message) ;
715+ let ( invoice, _ ) = extract_invoice ( bob, & onion_message) ;
716716 assert_eq ! ( invoice. amount_msats( ) , 10_000_000 ) ;
717717 assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
718718 assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
@@ -765,7 +765,7 @@ fn creates_and_pays_for_refund_using_one_hop_blinded_path() {
765765 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
766766 bob. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
767767
768- let invoice = extract_invoice ( bob, & onion_message) ;
768+ let ( invoice, _ ) = extract_invoice ( bob, & onion_message) ;
769769 assert_eq ! ( invoice, expected_invoice) ;
770770
771771 assert_eq ! ( invoice. amount_msats( ) , 10_000_000 ) ;
@@ -827,7 +827,7 @@ fn pays_for_offer_without_blinded_paths() {
827827 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
828828 bob. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
829829
830- let invoice = extract_invoice ( bob, & onion_message) ;
830+ let ( invoice, _ ) = extract_invoice ( bob, & onion_message) ;
831831 route_bolt12_payment ( bob, & [ alice] , & invoice) ;
832832 expect_recent_payment ! ( bob, RecentPaymentDetails :: Pending , payment_id) ;
833833
@@ -868,7 +868,7 @@ fn pays_for_refund_without_blinded_paths() {
868868 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
869869 bob. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
870870
871- let invoice = extract_invoice ( bob, & onion_message) ;
871+ let ( invoice, _ ) = extract_invoice ( bob, & onion_message) ;
872872 assert_eq ! ( invoice, expected_invoice) ;
873873
874874 route_bolt12_payment ( bob, & [ alice] , & invoice) ;
@@ -1012,7 +1012,7 @@ fn creates_offer_with_blinded_path_using_unannounced_introduction_node() {
10121012 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
10131013 bob. onion_messenger . handle_onion_message ( & alice_id, & onion_message) ;
10141014
1015- let invoice = extract_invoice ( bob, & onion_message) ;
1015+ let ( invoice, _ ) = extract_invoice ( bob, & onion_message) ;
10161016 assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
10171017 assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
10181018 for ( _, path) in invoice. payment_paths ( ) {
@@ -1061,7 +1061,7 @@ fn creates_refund_with_blinded_path_using_unannounced_introduction_node() {
10611061
10621062 let onion_message = alice. onion_messenger . next_onion_message_for_peer ( bob_id) . unwrap ( ) ;
10631063
1064- let invoice = extract_invoice ( bob, & onion_message) ;
1064+ let ( invoice, _ ) = extract_invoice ( bob, & onion_message) ;
10651065 assert_eq ! ( invoice, expected_invoice) ;
10661066 assert_ne ! ( invoice. signing_pubkey( ) , alice_id) ;
10671067 assert ! ( !invoice. payment_paths( ) . is_empty( ) ) ;
@@ -1517,7 +1517,7 @@ fn fails_paying_invoice_more_than_once() {
15171517
15181518 // David pays the first invoice
15191519 let payment_context = PaymentContext :: Bolt12Refund ( Bolt12RefundContext { } ) ;
1520- let invoice1 = extract_invoice ( david, & onion_message) ;
1520+ let ( invoice1, _ ) = extract_invoice ( david, & onion_message) ;
15211521
15221522 route_bolt12_payment ( david, & [ charlie, bob, alice] , & invoice1) ;
15231523 expect_recent_payment ! ( david, RecentPaymentDetails :: Pending , payment_id) ;
@@ -1539,7 +1539,7 @@ fn fails_paying_invoice_more_than_once() {
15391539 let onion_message = charlie. onion_messenger . next_onion_message_for_peer ( david_id) . unwrap ( ) ;
15401540 david. onion_messenger . handle_onion_message ( & charlie_id, & onion_message) ;
15411541
1542- let invoice2 = extract_invoice ( david, & onion_message) ;
1542+ let ( invoice2, _ ) = extract_invoice ( david, & onion_message) ;
15431543 assert_eq ! ( invoice1. payer_metadata( ) , invoice2. payer_metadata( ) ) ;
15441544
15451545 // David sends an error instead of paying the second invoice
0 commit comments