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 is_expired_no_std to Offer #2689

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

benthecarman
Copy link
Contributor

This was available for OfferContents but not an Offer so dependent projects could not access it.

@jkczyz jkczyz self-requested a review October 26, 2023 22:03
@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d2242f6) 88.78% compared to head (641d7a8) 88.73%.

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2689      +/-   ##
==========================================
- Coverage   88.78%   88.73%   -0.05%     
==========================================
  Files         112      112              
  Lines       88474    88486      +12     
  Branches    88474    88486      +12     
==========================================
- Hits        78553    78521      -32     
- Misses       7686     7726      +40     
- Partials     2235     2239       +4     
Files Coverage Δ
lightning/src/offers/offer.rs 94.81% <100.00%> (+0.03%) ⬆️
lightning/src/offers/refund.rs 93.86% <100.00%> (+0.04%) ⬆️

... and 10 files with indirect coverage changes

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

@@ -468,6 +468,11 @@ impl Offer {
self.contents.is_expired()
}

/// Whether the offer has expired given the duration since the Unix epoch.
pub fn is_expired_no_std(&self, duration_since_epoch: Duration) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add this to Refund? Also, would you mind updating builds_offer_with_absolute_expiry and builds_refund_with_absolute_expiry to call is_expired_no_std as well?

This was available for OfferContents but not an Offer so dependent
projects could not access it.
@TheBlueMatt TheBlueMatt merged commit b3e7aac into lightningdevkit:main Oct 29, 2023
@benthecarman benthecarman deleted the no-std-offer-expire branch October 29, 2023 19:46
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.

4 participants