feat: enhance reserve lifecycle with reclaim tracking and event emission#34
Merged
phertyameen merged 2 commits intobridgelet-org:mainfrom Feb 23, 2026
Merged
Conversation
phertyameen
reviewed
Feb 23, 2026
Contributor
phertyameen
left a comment
There was a problem hiding this comment.
Hi, your tests are not passing. Is this a work in progress?
Contributor
Author
|
@phertyameen the test is passing... thank you so much |
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.
This pull request introduces a comprehensive reserve lifecycle tracking system for ephemeral accounts, improving how reserve reclamation is handled, tracked, and reported. The changes add new storage fields, event payloads, and contract methods to enable precise tracking of reserve status, reclamation events, and amounts. Tests have been updated to validate the new reserve lifecycle features.
Reserve lifecycle tracking and reclamation:
storage.rsto track base reserve remaining, available reserve, reserve reclaimed status, last sweep ID, reserve event count, and last reserve event. This enables accurate state management and querying of reserve reclamation. [1] [2]ReserveReclaimedevent structure with additional fields (sweep_id,fully_reclaimed,remaining_reserve) and updated event emission logic to include these details, improving transparency and auditability of reserve reclamation. [1] [2]lib.rsfor querying reserve status (get_reserve_remaining,get_reserve_available,is_reserve_reclaimed,get_last_reserve_event,get_reserve_reclaim_event_count) and for safely reclaiming reserve (reclaim_reserve,reclaim_reserve_to). [1] [2]State transition and event emission improvements:
Test coverage enhancements:
test.rsto verify reserve lifecycle state, event emission, and correct behavior of new methods, including edge cases for reserve reclamation and querying. [1] [2] [3]These changes collectively provide robust tracking and control over the account reserve lifecycle, making the contract safer and easier to integrate and audit.
Closes #28