Skip to content

test: add test cases for role rotation and update test snapshots for …#340

Open
42natus wants to merge 1 commit into
StayLitCodes:mainfrom
42natus:Pause-policy
Open

test: add test cases for role rotation and update test snapshots for …#340
42natus wants to merge 1 commit into
StayLitCodes:mainfrom
42natus:Pause-policy

Conversation

@42natus
Copy link
Copy Markdown

@42natus 42natus commented May 29, 2026

Description

This PR addresses issue #304 to establish a deterministic pause policy that prioritizes safety and fairness. Previously, pausing the contract blocked all functionality. We have updated the policy to explicitly allow terminal fund-recovery states to continue operating while the contract is paused.

Changes Made

  • Allowed refund_expired During Pause: Removed the ensure_not_paused constraint from refund_expired. Depositors can now safely reclaim their funds if the deadline passes, even if the contract is paused due to an incident.
  • Allowed resolve_dispute During Pause: Ensured the arbitrator retains the ability to resolve ongoing disputes while the contract is paused.
  • Enhanced Pause Audit Logs: Updated the PausedToggledEvent to explicitly emit the caller address, caller_role (Operator), and the block timestamp to improve traceability of pause events.
  • Test Coverage: Added/updated unit tests (e.g., test_refund_expired_allowed_when_paused) to rigidly enforce that these terminal state functions succeed deterministically when the contract is paused.

Related Issues

Closes #304

Verification

  • Tested refund_expired logic in Active vs Paused states.
  • Verified resolve_dispute operates correctly under a Paused state.
  • Verified the expanded PausedToggledEvent schema compiles and emits correctly.
  • All test suites pass successfully locally (cargo test).

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@42natus 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

@Cedarich
Copy link
Copy Markdown
Contributor

Fix workflow

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.

[CONTRACT] Pause policy: define and enforce behavior for refund/dispute paths

2 participants