Skip to content

Commit 4dbb1f5

Browse files
committed
Unwrap reply_path in extract_invoice_request
1 parent 65771da commit 4dbb1f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lightning/src/ln/offers_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ fn claim_bolt12_payment<'a, 'b, 'c>(
179179

180180
fn extract_invoice_request<'a, 'b, 'c>(
181181
node: &Node<'a, 'b, 'c>, message: &OnionMessage
182-
) -> (InvoiceRequest, Option<BlindedPath>) {
182+
) -> (InvoiceRequest, BlindedPath) {
183183
match node.onion_messenger.peel_onion_message(message) {
184184
Ok(PeeledOnion::Receive(message, _, reply_path)) => match message {
185185
ParsedOnionMessageContents::Offers(offers_message) => match offers_message {
186-
OffersMessage::InvoiceRequest(invoice_request) => (invoice_request, reply_path),
186+
OffersMessage::InvoiceRequest(invoice_request) => (invoice_request, reply_path.unwrap()),
187187
OffersMessage::Invoice(invoice) => panic!("Unexpected invoice: {:?}", invoice),
188188
OffersMessage::InvoiceError(error) => panic!("Unexpected invoice_error: {:?}", error),
189189
},
@@ -420,7 +420,7 @@ fn creates_and_pays_for_offer_using_two_hop_blinded_path() {
420420
});
421421
assert_eq!(invoice_request.amount_msats(), None);
422422
assert_ne!(invoice_request.payer_id(), david_id);
423-
assert_eq!(reply_path.unwrap().introduction_node, IntroductionNode::NodeId(charlie_id));
423+
assert_eq!(reply_path.introduction_node, IntroductionNode::NodeId(charlie_id));
424424

425425
let onion_message = alice.onion_messenger.next_onion_message_for_peer(charlie_id).unwrap();
426426
charlie.onion_messenger.handle_onion_message(&alice_id, &onion_message);
@@ -573,7 +573,7 @@ fn creates_and_pays_for_offer_using_one_hop_blinded_path() {
573573
});
574574
assert_eq!(invoice_request.amount_msats(), None);
575575
assert_ne!(invoice_request.payer_id(), bob_id);
576-
assert_eq!(reply_path.unwrap().introduction_node, IntroductionNode::NodeId(bob_id));
576+
assert_eq!(reply_path.introduction_node, IntroductionNode::NodeId(bob_id));
577577

578578
let onion_message = alice.onion_messenger.next_onion_message_for_peer(bob_id).unwrap();
579579
bob.onion_messenger.handle_onion_message(&alice_id, &onion_message);

0 commit comments

Comments
 (0)