Skip to content

test: assert instance TTL is refreshed after deposit#683

Merged
yahia008 merged 2 commits into
StellarCheckMate:mainfrom
D-Ochuko:feat/Add_Test_escrow_instance_TTL_is_refreshed_after_deposit
May 28, 2026
Merged

test: assert instance TTL is refreshed after deposit#683
yahia008 merged 2 commits into
StellarCheckMate:mainfrom
D-Ochuko:feat/Add_Test_escrow_instance_TTL_is_refreshed_after_deposit

Conversation

@D-Ochuko
Copy link
Copy Markdown
Contributor

closes #619

Deposit is a hot path that reads instance config (Oracle, Admin, Paused). Extend instance TTL on every deposit so those entries stay alive, and add a test that advances the ledger then calls deposit and asserts the instance TTL equals MATCH_TTL_LEDGERS.

Changes made:

  1. contracts/escrow/src/lib.rs — added env.storage().instance().extend_ttl(MATCH_TTL_LEDGERS, MATCH_TTL_LEDGERS) at the end of deposit, so the instance storage (which holds Oracle, Admin, MatchCount, Paused config) stays alive on every deposit call.

  2. contracts/escrow/src/tests.rs — added Instance as _ to the existing storage testutils import, and added the new test test_instance_ttl_refreshed_after_deposit which advances the ledger by 1000 sequences after create_match, calls deposit, then
    asserts the instance TTL equals MATCH_TTL_LEDGERS.

Deposit is a hot path that reads instance config (Oracle, Admin,
Paused). Extend instance TTL on every deposit so those entries
stay alive, and add a test that advances the ledger then calls
deposit and asserts the instance TTL equals MATCH_TTL_LEDGERS.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 28, 2026

@D-Ochuko 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

@yahia008 yahia008 merged commit 4111266 into StellarCheckMate:main May 28, 2026
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 Test: escrow instance TTL is refreshed after deposit

2 participants