Skip to content

test(escrow): add transient TTL expiry tests#363

Merged
mikewheeleer merged 1 commit into
Talenttrust:mainfrom
paulinaapeh8:test/storage-ttl
May 27, 2026
Merged

test(escrow): add transient TTL expiry tests#363
mikewheeleer merged 1 commit into
Talenttrust:mainfrom
paulinaapeh8:test/storage-ttl

Conversation

@paulinaapeh8
Copy link
Copy Markdown
Contributor

  • Add 15 deterministic tests in contracts/escrow/src/test/ttl_tests.rs covering all six TTL helpers (compute_expiry, store_with_ttl, read_if_live, extend_if_below_threshold, remove_transient, has_transient) for both PENDING_APPROVAL_TTL_LEDGERS (7 days) and PENDING_MIGRATION_TTL_LEDGERS (21 days)
  • Tests advance env.ledger().sequence_number to prove Soroban auto-eviction: read_if_live returns Some before TTL elapses and None after
  • extend_if_below_threshold: returns false for absent key, returns true and keeps entry live past original expiry after bump
  • Wire ttl_tests module into contracts/escrow/src/test/mod.rs
  • Add rustdoc comments to all public TTL functions and constants in ttl.rs; remove per-function #[allow(dead_code)] (crate-level allow covers it)
  • Update docs/escrow/storage-ttl.md with accurate test names, helper API table, security notes, and reviewer checklist

Closes #328

- Add 15 deterministic tests in contracts/escrow/src/test/ttl_tests.rs
  covering all six TTL helpers (compute_expiry, store_with_ttl,
  read_if_live, extend_if_below_threshold, remove_transient, has_transient)
  for both PENDING_APPROVAL_TTL_LEDGERS (7 days) and
  PENDING_MIGRATION_TTL_LEDGERS (21 days)
- Tests advance env.ledger().sequence_number to prove Soroban auto-eviction:
  read_if_live returns Some before TTL elapses and None after
- extend_if_below_threshold: returns false for absent key, returns true and
  keeps entry live past original expiry after bump
- Wire ttl_tests module into contracts/escrow/src/test/mod.rs
- Add rustdoc comments to all public TTL functions and constants in ttl.rs;
  remove per-function #[allow(dead_code)] (crate-level allow covers it)
- Update docs/escrow/storage-ttl.md with accurate test names, helper API
  table, security notes, and reviewer checklist

Closes Talenttrust#328
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@paulinaapeh8 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

@mikewheeleer mikewheeleer merged commit f0f34ff into Talenttrust:main May 27, 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.

Add storage TTL tests for transient approval and migration entries

2 participants