-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose signable hashes for BOLT 11 and BOLT 12 invoices #2162
Conversation
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #2162 +/- ##
==========================================
+ Coverage 91.33% 92.36% +1.03%
==========================================
Files 101 103 +2
Lines 48837 64849 +16012
Branches 48837 64849 +16012
==========================================
+ Hits 44604 59901 +15297
- Misses 4233 4948 +715
... and 49 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
lightning-invoice/src/lib.rs
Outdated
@@ -1021,6 +1021,11 @@ impl From<PositiveTimestamp> for SystemTime { | |||
} | |||
|
|||
impl Invoice { | |||
/// The hash of the `RawInvoice` that was signed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linkified all the the things!
Otherwise, an Invoice must first be converted to a SignedRawInvoice to obtain the hash.
This is useful as an identifier for downstream clients like VLS.
e7b1774
to
39befa1
Compare
These are useful for downstream clients needing an invoice identifier. The BOLT 11 invoice hash is already accessible but requires consuming or cloning the invoice first. For BOLT 12, the hash is only used when calculating or verifying a signature, so it is recomputed for simplicity.