Skip to content

test: cover pause/unpause events and idempotent toggling - #54

Merged
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
Jagadeeshftw:test/contracts-pause-events
Jun 24, 2026
Merged

test: cover pause/unpause events and idempotent toggling#54
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
Jagadeeshftw:test/contracts-pause-events

Conversation

@Jagadeeshftw

Copy link
Copy Markdown
Contributor

Summary

Adds test-only coverage (in contracts/escrow/src/test.rs) for the pause switch:

  • pause() emits a paused event carrying the bool true; the contract reads paused.
  • unpause() emits a paused event carrying the bool false; the contract reads unpaused.
  • Double-pause and double-unpause are idempotent — is_paused stays consistent across repeated calls.
  • A pause -> pause -> unpause sequence ends unpaused.

A module header note documents the covered behavior and records that auth is mocked (env.mock_all_auths()), so only the admin/happy path and idempotency are exercised; non-admin rejection is not asserted. No changes to lib.rs.

Closes #42

Test output

test result: ok. 28 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.20s

Security notes: Test-only change; admin-gating logic is unchanged and auth remains mocked in tests, so this adds no new trust assumptions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Jagadeeshftw
Jagadeeshftw force-pushed the test/contracts-pause-events branch from ca87f8d to b3ded35 Compare June 24, 2026 02:30
@mikewheeleer

Copy link
Copy Markdown
Contributor

solid coverage on the pause/unpause events and idempotency. merging 🚀

mikewheeleer added a commit that referenced this pull request Jun 24, 2026
…uard, schema-version stamp, and expanded test coverage
@mikewheeleer
mikewheeleer merged commit 22bae7e into Agentpay-Org:main Jun 24, 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 tests for pause/unpause event emission and idempotent toggling

2 participants