From 35a1693f2a733723d97928831ab0f7c3348de13b Mon Sep 17 00:00:00 2001 From: Erick Cestari Date: Mon, 18 Aug 2025 12:11:19 -0300 Subject: [PATCH] test: add test for offer parsing with empty paths and valid issuer Verifies that offers with empty paths are accepted as long as the issuer_id is set. --- lightning/src/offers/offer.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lightning/src/offers/offer.rs b/lightning/src/offers/offer.rs index 7fd2c4e60e2..559924f1ca2 100644 --- a/lightning/src/offers/offer.rs +++ b/lightning/src/offers/offer.rs @@ -2002,6 +2002,13 @@ mod tests { panic!("error parsing offer: {:?}", e); } + let mut builder = OfferBuilder::new(pubkey(42)); + builder.offer.paths = Some(vec![]); + let offer = builder.build().unwrap(); + if let Err(e) = offer.to_string().parse::() { + panic!("error parsing offer: {:?}", e); + } + let mut builder = OfferBuilder::new(pubkey(42)); builder.offer.issuer_signing_pubkey = None; builder.offer.paths = Some(vec![]);