Description
contracts/escrow/src/test/mod.rs only declares emergency_controls and pause_controls, so cargo test runs just 31 tests. The test files deposit.rs, release.rs, refund.rs, and create_contract.rs at the crate root reference functions like refund_unreleased_milestones and get_milestones with outdated signatures and are never compiled. Reconcile and wire these suites into the test module.
Requirements and context
- Scoped to TalentTrust
escrow Soroban contract (contracts/escrow).
- Move/align the orphaned suites under
contracts/escrow/src/test/ and declare them in mod.rs; update signatures to match the current EscrowClient API.
- Fix calls such as
release_milestone(&id, &0) to match the authorized signature introduced by the auth hardening work.
- Acceptance:
cargo test discovers and passes the migrated suites; no orphaned .rs test files remain at the crate root.
- Must be secure, tested, and documented.
Suggested execution
- Fork the repo and create a branch:
git checkout -b test/wire-orphaned-suites
- Implement changes:
contracts/escrow/src/test/mod.rs
- Tests:
contracts/escrow/src/test/deposit.rs
- Docs:
docs/escrow/tests.md
- Include rustdoc/NatSpec-style doc comments on public functions
- Validate security assumptions (auth, overflow, fail-closed state machine, storage TTL, fee accounting)
Test and commit
- Run tests:
cargo test
- Cover edge cases (unauthorized callers, double release/refund, expired approvals, fee rounding, paused state)
- Include test output and security notes in the PR
Example commit message
test(escrow): wire orphaned deposit/release/refund suites
Guidelines
- Minimum 95% test coverage on new/changed code
- Clear documentation
- Timeframe: 96 hours from assignment
Description
contracts/escrow/src/test/mod.rsonly declaresemergency_controlsandpause_controls, socargo testruns just 31 tests. The test filesdeposit.rs,release.rs,refund.rs, andcreate_contract.rsat the crate root reference functions likerefund_unreleased_milestonesandget_milestoneswith outdated signatures and are never compiled. Reconcile and wire these suites into the test module.Requirements and context
escrowSoroban contract (contracts/escrow).contracts/escrow/src/test/and declare them inmod.rs; update signatures to match the currentEscrowClientAPI.release_milestone(&id, &0)to match the authorized signature introduced by the auth hardening work.cargo testdiscovers and passes the migrated suites; no orphaned.rstest files remain at the crate root.Suggested execution
git checkout -b test/wire-orphaned-suitescontracts/escrow/src/test/mod.rscontracts/escrow/src/test/deposit.rsdocs/escrow/tests.mdTest and commit
cargo testExample commit message
Guidelines