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.
Block release_milestone, deposit, and refund on a Disputed contract via tests
Description
raise_disputetransitions a contract toDisputedprecisely to freeze releases until an arbiter resolves it.release_milestoneincontracts/escrow/src/lib.rsrequiresstatus == Funded, so a release on a disputed contract should fail — but there is no explicit regression test asserting this, andrefund_unreleased_milestonesdoes allowDisputed, whiledeposit_fundsrequiresCreated. 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
release_milestoneon aDisputedcontract panics withInvalidState.deposit_fundson aDisputedcontract panics withInvalidState.refund_unreleased_milestonesbehavior onDisputedmatches the documented intent (currently allowed).Suggested execution
git checkout -b test/contracts-disputed-state-operationscontracts/escrow/src/lib.rs.contracts/escrow/src/test/dispute.rs.docs/escrow.///) on any helper.Test and commit
cargo fmt --all -- --check,cargo build, andcargo test.cargo testoutput in the PR description.Example commit message
test: pin money-flow operations blocked during disputeGuidelines
Community & contribution rewards