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
Description
proptestis declared as a dev-dependency incontracts/escrow/Cargo.tomlandcontracts/escrow/src/proptest.rsplusfuzz_test.rsexist, but neither is referenced fromlib.rs, so no property-based tests run. Wire these modules in and ensure their generators target real entrypoints.Requirements and context
escrowSoroban contract (contracts/escrow).#[cfg(test)] mod proptest;and#[cfg(test)] mod fuzz_test;tolib.rs(or under the test module) and fix any compilation drift.check_accounting_invariantnever panics unexpectedly.cargo testexecutes the property suites; cases shrink to minimal counterexamples on failure.Suggested execution
git checkout -b test/wire-proptest-fuzzcontracts/escrow/src/lib.rscontracts/escrow/src/proptest.rsdocs/escrow/fuzzing.mdTest and commit
cargo testExample commit message
Guidelines