feat(#139): add TTL auto-renewal for active users#158
Open
kimmoris12345 wants to merge 1 commit into
Open
Conversation
- Add renew_all_ttls(user) admin function that extends metadata TTLs - Document TTL lifecycle in extend_ttl doc comment and SECURITY_RECOMMENDATIONS.md - Add 5 unit tests covering metadata renewal, old wrap preservation, and admin auth - All 54 tests pass
|
@kimmoris12345 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.
Closes #139
Summary
Adds TTL auto-renewal for active users so that their metadata keys (WrapCount, LatestPeriod) stay alive when they mint new wraps. Historical wrap records are not auto-renewed — that requires period enumeration (Issue #90).
Changes
src/lib.rsrenew_all_ttls(user)(line 457): New admin-only function that extends TTL forWrapCount,LatestPeriod, and the contract instance. Documents dependency on Issue feat: Add multi-period wrap summary query (aggregate stats across months) #90 for full wrap enumeration.extend_ttldoc comment (line 383): Comprehensive TTL lifecycle documentation covering automatic metadata renewal, manual wrap renewal, admin bulk renewal, and expiry risk.src/test.rs— 5 new tests (line 1291)test_metadata_ttl_extended_on_new_mintWrapCountandLatestPeriodsurvive across multiple mintstest_old_wrap_preserved_on_new_minttest_renew_all_ttls_extends_metadatatest_renew_all_ttls_requires_admin_authtest_renew_all_ttls_before_init_failsSECURITY_RECOMMENDATIONS.mdDesign Decision
Auto-renew metadata only —
WrapCountandLatestPeriodwere already being extended on everymint_wrap. This PR documents that behavior and addsrenew_all_ttlsfor admin bulk metadata renewal. Historical wraps are not auto-renewed because period enumeration (Issue #90) is required to iterate them on-chain.Verification
All 54 tests pass (
cargo test).