Repository navigation
Subscription: optional end ledger (subscribe_until) - #139
Merged
Merged
Conversation
stellar-sub#52) Add subscribe_until, which takes an end ledger, next to the unchanged subscribe so no caller breaks. Subscription gains an expires_at field, where 0 means no end. No charge is allowed after that ledger: charge returns SubscriptionExpired, and is_chargeable returns false, so the end only narrows what the merchant may do. An end ledger that is not after the current ledger is refused with InvalidExpiry. subscribe and subscribe_until share one creation path. Tests cover charging up to and including the end ledger, refusal after it with state unchanged, invalid end ledgers, and a plain subscription having no end. The Subscription layout changes, so subscriptions stored by an earlier version do not have the new field. Closes stellar-sub#52 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@edwina105 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Subscription: optional end ledger (subscribe_until)
Adds
subscribe_until, which takes an end ledger, next to the unchangedsubscribe, so no caller breaks.Subscriptiongainsexpires_at(0 means no end).chargereturnsSubscriptionExpiredandis_chargeablereturns false, so the end only narrows what the merchant may do.InvalidExpiry.subscribeandsubscribe_untilshare one creation path.Closes #52
The issue was marked "Needs design" and asked for maintainer agreement first. This PR implements it at the contributor's request, using the
subscribe_untiloption from the design proposal. Maintainers may prefer to changesubscribeinstead. TheSubscriptionlayout changes, so subscriptions stored by an earlier version lack the new field.The code has not been compiled or run. Please check it in CI.
🤖 Generated with Claude Code