Skip to content

Block release_milestone, deposit, and refund on a Disputed contract via tests #551

Description

@mikewheeleer

Block release_milestone, deposit, and refund on a Disputed contract via tests

Description

raise_dispute transitions a contract to Disputed precisely to freeze releases until an arbiter resolves it. release_milestone in contracts/escrow/src/lib.rs requires status == Funded, so a release on a disputed contract should fail — but there is no explicit regression test asserting this, and refund_unreleased_milestones does allow Disputed, while deposit_funds requires Created. The exact behavior during a dispute is therefore implicit and unguarded.

This issue pins down, with tests, exactly which money-flow operations are blocked or allowed while a contract is Disputed.

Requirements and context

  • Repository scope: Talenttrust/Talenttrust-Contracts only.
  • Test: release_milestone on a Disputed contract panics with InvalidState.
  • Test: deposit_funds on a Disputed contract panics with InvalidState.
  • Test: refund_unreleased_milestones behavior on Disputed matches the documented intent (currently allowed).
  • Document the disputed-state operation matrix.

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b test/contracts-disputed-state-operations
  • Implement changes
  • Test and commit

Test and commit

  • Run cargo fmt --all -- --check, cargo build, and cargo test.
  • Cover release, deposit, and refund against a disputed contract.
  • Include the full cargo test output in the PR description.

Example commit message

test: pin money-flow operations blocked during dispute

Guidelines

  • Minimum 95 percent test coverage for impacted modules.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the TalentTrust community on Discord for questions, reviews, and faster merges: https://discord.gg/WqnGpcPx
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions