Skip to content

Wire proptest and fuzz_test modules into the build #325

@mikewheeleer

Description

@mikewheeleer

Description

proptest is declared as a dev-dependency in contracts/escrow/Cargo.toml and contracts/escrow/src/proptest.rs plus fuzz_test.rs exist, but neither is referenced from lib.rs, so no property-based tests run. Wire these modules in and ensure their generators target real entrypoints.

Requirements and context

  • Scoped to TalentTrust escrow Soroban contract (contracts/escrow).
  • Add #[cfg(test)] mod proptest; and #[cfg(test)] mod fuzz_test; to lib.rs (or under the test module) and fix any compilation drift.
  • Property generators should exercise milestone amount arrays, deposit sequences, and release/refund orderings, asserting check_accounting_invariant never panics unexpectedly.
  • Acceptance: cargo test executes the property suites; cases shrink to minimal counterexamples on failure.
  • Must be secure, tested, and documented.

Suggested execution

  • Fork the repo and create a branch:
    • git checkout -b test/wire-proptest-fuzz
  • Implement changes:
    • contracts/escrow/src/lib.rs
    • Tests: contracts/escrow/src/proptest.rs
    • Docs: docs/escrow/fuzzing.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): enable proptest and fuzz_test modules

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