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

Replace InvoicePayer with utility methods #2007

Conversation

valentinewallace
Copy link
Contributor

@valentinewallace valentinewallace commented Feb 3, 2023

We're moving payment retries to ChannelManager in preparation for supporting trampoline payments.

Partially addresses #1932

Based on #2002 with another small commit taken from #1996

@codecov-commenter
Copy link

codecov-commenter commented Feb 3, 2023

Codecov Report

Base: 90.89% // Head: 91.07% // Increases project coverage by +0.17% 🎉

Coverage data is based on head (b7c5e47) compared to base (760ab65).
Patch has no changes to coverable lines.

❗ Current head b7c5e47 differs from pull request most recent head a23b5eb. Consider uploading reports for the commit a23b5eb to get more accurate results

📣 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    #2007      +/-   ##
==========================================
+ Coverage   90.89%   91.07%   +0.17%     
==========================================
  Files          99       99              
  Lines       53026    51731    -1295     
  Branches    53026    51731    -1295     
==========================================
- Hits        48197    47113    -1084     
+ Misses       4829     4618     -211     
Impacted Files Coverage Δ
lightning-background-processor/src/lib.rs 86.02% <ø> (-0.33%) ⬇️
lightning-invoice/src/payment.rs 90.44% <ø> (+0.78%) ⬆️
lightning-invoice/src/utils.rs 97.59% <ø> (-0.05%) ⬇️
lightning/src/util/fairrwlock.rs 70.58% <0.00%> (-17.65%) ⬇️
lightning/src/util/events.rs 29.56% <0.00%> (-1.64%) ⬇️
lightning/src/ln/outbound_payment.rs 89.38% <0.00%> (-0.80%) ⬇️
lightning-invoice/src/lib.rs 86.32% <0.00%> (-0.49%) ⬇️
lightning/src/chain/channelmonitor.rs 91.02% <0.00%> (-0.10%) ⬇️
lightning/src/ln/functional_tests.rs 96.97% <0.00%> (-0.10%) ⬇️
lightning/src/routing/scoring.rs 97.31% <0.00%> (-0.02%) ⬇️
... and 5 more

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@valentinewallace
Copy link
Contributor Author

Rebased so I could get the changes from #1873 in #2008

@valentinewallace
Copy link
Contributor Author

Fixed bad doc link

diff --git a/lightning-invoice/src/payment.rs b/lightning-invoice/src/payment.rs
index 787219d88..6b70d960b 100644
--- a/lightning-invoice/src/payment.rs
+++ b/lightning-invoice/src/payment.rs
@@ -257,12 +257,16 @@ pub enum PaymentError {
 /// Useful for unit testing internal methods.
 trait Payer {
        /// Sends a payment over the Lightning Network using the given [`Route`].
+       ///
+       /// [`Route`]: lightning::routing::router::Route
        fn send_payment(
                &self, payment_hash: PaymentHash, payment_secret: &Option<PaymentSecret>,
                payment_id: PaymentId, route_params: RouteParameters, retry_strategy: Retry
        ) -> Result<(), PaymentError>;

        /// Sends a spontaneous payment over the Lightning Network using the given [`Route`].
+       ///
+       /// [`Route`]: lightning::routing::router::Route
        fn send_spontaneous_payment(
                &self, payment_preimage: PaymentPreimage, payment_id: PaymentId, route_params: RouteParameters,
                retry_strategy: Retry

Copy link
Contributor

@dunxen dunxen left a comment

Choose a reason for hiding this comment

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

Looks good from a first review

lightning-invoice/src/payment.rs Outdated Show resolved Hide resolved
lightning-invoice/src/payment.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

LGTM feel free to squash. I think we need to migrate considers_inflight_htlcs_between_retries and fails_retrying_invoice_after_expiration but that can come in a followup.

lightning-invoice/src/payment.rs Outdated Show resolved Hide resolved
dunxen
dunxen previously approved these changes Feb 6, 2023
@TheBlueMatt TheBlueMatt merged commit ce2ed44 into lightningdevkit:main Feb 7, 2023
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

4 participants