Skip to content

implemented TTL and storage ledger extension for escrow - #33

Merged
Tybravo merged 1 commit into
SwiftChainn:mainfrom
Ogstevyn:feat/escrow-ttl-storage-extension
Apr 23, 2026
Merged

implemented TTL and storage ledger extension for escrow#33
Tybravo merged 1 commit into
SwiftChainn:mainfrom
Ogstevyn:feat/escrow-ttl-storage-extension

Conversation

@Ogstevyn

Copy link
Copy Markdown
Contributor

Summary

  • Defined ESCROW_TTL_THRESHOLD (518,400 ledgers ≈ 30 days) and ESCROW_TTL_EXTEND_TO (1,555,200 ledgers ≈ 90 days) in a mod constants block with inline rationale comments
  • Escrow amount is now stored in persistent() storage (correct type for escrow records under Stellar's state-rent model) with TTL extended on every write
  • Instance storage for admin config (admin, pending_admin) has TTL extended on every admin action: init, propose_admin, and accept_admin
  • Added get_amount view function to support persistent storage verification in tests
  • Added 3 unit tests covering TTL extension on escrow create and both admin actions

Test plan

  • test_init_and_get_status — existing test still passes
  • test_propose_and_accept_admin — still passes with TTL calls added
  • test_accept_admin_rejected_for_non_pending — still panics correctly
  • test_admin_cleared_after_transfer — still passes
  • test_admin_transfer_emits_event — still passes
  • test_init_persists_escrow_amount_with_ttl — amount is readable from persistent storage after init
  • test_propose_admin_extends_instance_ttl — propose_admin succeeds with TTL extension, state correct
  • test_accept_admin_extends_instance_ttl — accept_admin succeeds with TTL extension, admin updated

Closes #15

@drips-wave

drips-wave Bot commented Apr 23, 2026

Copy link
Copy Markdown

@Ogstevyn 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! 🚀

Learn more about application limits

@Tybravo
Tybravo merged commit b68a5d3 into SwiftChainn:main Apr 23, 2026
1 check failed
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.

Smart Contract: Implement Escrow TTL and Storage Ledger Extension

2 participants