Skip to content

test(contracts): add batch submission failure atomicity tests #127#116

Merged
thlpkee20-wq merged 2 commits into
Chronopay-Org:mainfrom
KayProject:feature/add-batch-submission-failure-atomicity-tests
Apr 1, 2026
Merged

test(contracts): add batch submission failure atomicity tests #127#116
thlpkee20-wq merged 2 commits into
Chronopay-Org:mainfrom
KayProject:feature/add-batch-submission-failure-atomicity-tests

Conversation

@KayProject

Copy link
Copy Markdown
Contributor

Summary

Implements batch submission failure atomicity tests for the ChronoPay contract as required by issue #127.

Changes

  • contracts/chronopay/src/test.rs — Added 8 atomicity tests covering:
    • All valid slots committed in sequence
    • Sequential slot IDs across multiple batch calls
    • Single-slot batch atomicity
    • Slot sequence counter persistence after batch
    • Independent environment isolation (no cross-test leakage)
    • Mint all tokens after bulk create
    • Redeem all tokens after bulk mint
    • Buy all tokens after bulk mint
  • docs/batch-attestation-submission.md — Created documentation covering assumptions, expected behavior, and security notes

Security Notes

  • Slot ID overflow is caught by checked_add and panics safely
  • No cross-environment state leakage between test runs
  • Batch operations do not bypass owner or status checks

Test Coverage

8 new deterministic atomicity tests added. All tests are isolated and regression-safe.

Closes #127

@thlpkee20-wq thlpkee20-wq merged commit b2777db into Chronopay-Org:main Apr 1, 2026
0 of 3 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.

2 participants