lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.15k stars 363 forks source link

Allow Asynchronously responding to Invoice Request #3318

Open shaavan opened 2 weeks ago

shaavan commented 2 weeks ago

Introduce a new event and set of supporting functions to allow flexibility in responding asynchronously to a received invoice request.

This PR provides foundational work for further improvements in future. For example, this allows supporting Offers created in currency denomination, as a user can do appropriate pre-processing for a received InvoiceRequest, before sending an Invoice for it.

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 74.01575% with 66 lines in your changes missing coverage. Please review.

Project coverage is 89.57%. Comparing base (66fb520) to head (9b4daa4).

Files with missing lines Patch % Lines
lightning/src/ln/channelmanager.rs 74.82% 34 Missing and 1 partial :warning:
lightning/src/events/mod.rs 0.00% 19 Missing :warning:
lightning/src/offers/invoice.rs 73.07% 4 Missing and 3 partials :warning:
lightning/src/offers/invoice_request.rs 57.14% 3 Missing :warning:
lightning/src/ln/offers_tests.rs 96.72% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3318 +/- ## ========================================== - Coverage 89.64% 89.57% -0.07% ========================================== Files 126 126 Lines 102676 102849 +173 Branches 102676 102849 +173 ========================================== + Hits 92045 92132 +87 - Misses 7912 7987 +75 - Partials 2719 2730 +11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

shaavan commented 1 week ago

Updated from pr3318.01 to pr3318.02 (diff):

Changes:

  1. Rebase on main to resolve merge conflicts and fix CI.
shaavan commented 1 week ago

Updated from pr3318.02 to pr3318.03 (diff): Addressed @jkczyz comments

Changes:

  1. Update Responder to be required field.
  2. Update InvoiceRequestReceived Docs.
  3. Update condition check when the Custom Amount should be provided.
  4. Create the InvoiceRequestReceived event only when InvoiceRequest is verified.