bolt12: export DecodeOffer - #11199
Open
usefahmed07 wants to merge 1 commit into
Open
usefahmed07 wants to merge 1 commit into
usefahmed07 wants to merge 1 commit into
Conversation
🟡 PR Severity: MEDIUM
🟡 Medium (1 file)
🟢 Low (2 files)
AnalysisThis PR exports To override, add a |
This was referenced Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Exports
bolt12.decodeOfferasbolt12.DecodeOffer, mirroring theexisting exported decode functions for the other BOLT 12 messages
(
DecodeInvoice,DecodeInvoiceRequest,DecodeInvoiceError).Currently
decodeOfferis unexported and only referenced from thepackage's own tests, so there is no public entry point to parse a raw
BOLT 12 offer TLV stream from outside the
bolt12package.Motivation
bitcoinfuzz, a
differential fuzzing project for Bitcoin/Lightning implementations,
has an open issue to add LND to its
deserialize_offerfuzz target(bitcoinfuzz/bitcoinfuzz#586), which references this work
(#10736). That target needs a public decode
function to call from outside the package, exactly like the ones
already exported for Invoice/InvoiceRequest/InvoiceError.
Changes
bolt12/offer.go: renamedecodeOffer->DecodeOffer(doc commentupdated accordingly).
bolt12/offer_test.go,bolt12/invoice_request_test.go: update thetwo internal call-sites to use the new exported name.
No behavioral change - this is a pure rename/export, decoding logic is
untouched. As noted in the function's doc comment, callers that need a
valid offer (not just a syntactically decodable one) should still run
ValidateOfferReadafterwards.