Skip to content

Wire orphaned test modules (deposit, release, refund, create_contract) into mod test #324

@mikewheeleer

Description

@mikewheeleer

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

Metadata

Metadata

Assignees

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions