Skip to content
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

Add helper function for getting preimage from PaymentPurpose #2768

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

benthecarman
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (6b43153) 88.64% compared to head (00f578a) 88.58%.

Files Patch % Lines
lightning/src/events/mod.rs 0.00% 5 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2768      +/-   ##
==========================================
- Coverage   88.64%   88.58%   -0.06%     
==========================================
  Files         115      115              
  Lines       90257    90262       +5     
  Branches    90257    90262       +5     
==========================================
- Hits        80009    79963      -46     
- Misses       7842     7886      +44     
- Partials     2406     2413       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

/// Returns the preimage for this payment, if it is known.
pub fn preimage(&self) -> Option<PaymentPreimage> {
match self {
PaymentPurpose::InvoicePayment { payment_preimage, .. } => *payment_preimage,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know its in the original impl, but out of curiosity,
in which scenarios we wouldnt have the payment_preimage in the traditional invoice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When creating an invoice you can just supply the payment hash and have the preimage stored externally to ldk

Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@TheBlueMatt TheBlueMatt merged commit 1eddd1e into lightningdevkit:main Dec 4, 2023
15 checks passed
@benthecarman benthecarman deleted the preimage-helper branch December 4, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants