Skip to content

Comments

feat: add reserve lifecycle events#32

Merged
phertyameen merged 8 commits intobridgelet-org:mainfrom
Cybermaxi7:feature/reserve-lifecycle-events
Feb 21, 2026
Merged

feat: add reserve lifecycle events#32
phertyameen merged 8 commits intobridgelet-org:mainfrom
Cybermaxi7:feature/reserve-lifecycle-events

Conversation

@Cybermaxi7
Copy link
Contributor

@Cybermaxi7 Cybermaxi7 commented Feb 21, 2026

PR Title

feat: Add reserve lifecycle events for sweep and expiration
Closes #30

Description

This PR adds event visibility for the base reserve (1 XLM) reclamation process during account sweep and expiration operations.

Changes

New Events:

  • Added ReserveReclaimed event with:
    • destination: Address - where the reserve is returned
    • amount: i128 - reserve amount in stroops (1 XLM = 1,000,000,000 stroops)

Extended Events:

  • AccountExpired now includes reserve_amount: i128 field

Implementation:

  • sweep() now emits ReserveReclaimed after successful sweep
  • expire() now emits both AccountExpired (with reserve_amount) and ReserveReclaimed
  • Reserve amount is a constant 1 XLM base reserve per Stellar protocol

Tests:

  • Added test_sweep_emits_reserve_reclaimed_event
  • Added test_sweep_multiple_assets_with_reserve_event

Cleanup:

  • Deleted placeholder contracts/reserve_contract/reserve.md

Acceptance Criteria

  • Events emitted on sweep reclaim
  • Events emitted on expiration reclaim
  • Covered by tests
  • No documentation-only implementation remains
  • All reserve functionality exists in code
  • Workspace builds and tests pass

Safety Considerations

This change only adds event emission and does not modify any balance transfer logic or state management. The reserve amount is a constant (1 XLM) and is emitted for off-chain indexing/monitoring purposes only.

@phertyameen phertyameen merged commit d1599d1 into bridgelet-org:main Feb 21, 2026
1 check passed
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.

Add Reserve Reclamation Events

2 participants