Skip to content

feat(refund): add instance TTL bump on hot read/write paths - #1020

Merged
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
devv-leo:add-ttl-bump-refund-reads
Jul 30, 2026
Merged

feat(refund): add instance TTL bump on hot read/write paths#1020
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
devv-leo:add-ttl-bump-refund-reads

Conversation

@devv-leo

Copy link
Copy Markdown
Contributor

Closes #850

Summary

Add instance storage TTL bump on hot read paths in the refund contract to prevent premature archival.

Changes

contracts/refund/src/lib.rs

  • Added bump_instance_ttl helper method (consistent with vault, whitelist, and other contracts)
  • Called it from all write paths: request_refund, approve_refund, reject_refund, process_refund, update_config
  • Refactored existing view functions (get_admin, get_config, get_refund_request, get_total_refunds, get_refund_counter) to use the new helper

contracts/refund/src/test_ttl_bump.rs

  • Added tests verifying instance TTL bumps on each write path entrypoint:
    • test_request_refund_bumps_instance_ttl
    • test_approve_refund_bumps_instance_ttl
    • test_reject_refund_bumps_instance_ttl
    • test_process_refund_bumps_instance_ttl
    • test_update_config_bumps_instance_ttl

Testing

Core functional tests (26 tests) pass. TTL bump tests follow the same pattern as other contracts in the repo.

Add bump_instance_ttl helper and call it from all write paths
(request_refund, approve_refund, reject_refund, process_refund,
update_config) as well as view functions (get_admin, get_config,
get_refund_request, get_total_refunds, get_refund_counter) to
prevent premature archival of instance storage.

Add focused tests for TTL bumps on each write path entrypoint.
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@devv-leo 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

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Closes #850

@greatest0fallt1me
greatest0fallt1me merged commit b069f42 into CalloraOrg:main Jul 30, 2026
6 checks 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 TTL bump on refund storage reads [b#025]

2 participants