Skip to content

Add property-based coverage for the MAX_VAULT_DURATION boundary in create_vault #230

Description

@1nonlypiece

📌 Description

tests/proptest_timestamps.rs checks ordering and the duration bound, but the
exact MAX_VAULT_DURATION boundary (end - start == MAX_VAULT_DURATION accepted
vs + 1 rejected with Error::DurationTooLong) deserves dedicated, randomized
coverage around the edge. The start_timestamp < current_time rejection path
also lacks property coverage.

Goal: extend the timestamp property tests to densely sample the duration
boundary and the past-start rejection across a randomized ledger time.

🎯 Requirements and Context

  • Must be deterministic given a fixed proptest seed.
  • Assert duration == MAX_VAULT_DURATION accepts and +1 rejects with
    Error::DurationTooLong.
  • Assert start_timestamp < ledger.timestamp() rejects with Error::InvalidTimestamp.
  • Avoid u64 overflow in generated start + duration (bounded strategies).

🛠️ Suggested Execution

1. Fork the repo and create a branch

git checkout -b feature/duration-boundary-proptests

2. Implement changes

  • Tests: extend tests/proptest_timestamps.rs with boundary and past-start
    strategies, plus explicit edge vectors at exactly MAX_VAULT_DURATION.
  • Docs: update the "Property Tests for Timestamp Ordering" section of
    TESTING_GUIDE.md.

3. Test and commit

  • Run cargo test and regenerate coverage.
  • Cover edge cases: duration exactly at max, max+1, start in the past, start ==
    now, very large bounded start_offset.

Example commit message

test: property coverage for MAX_VAULT_DURATION boundary in create_vault

✅ Guidelines

  • Minimum 95% test coverage on the duration/timestamp branches.
  • Clear documentation of the new property strategies.
  • All tests deterministic under a fixed seed.
  • Timeframe: 96 hours.

🏷️ Labels

type-testing · area-contracts · MAYBE REWARDED · GRANTFOX OSS ·
OFFICIAL CAMPAIGN

💬 Community & Support

  • Join the Disciplr contributor Discord to coordinate, ask questions, and get
    unblocked fast: https://discord.gg/xvNAvMJf
  • Please introduce yourself before you start so we can avoid duplicate work,
    pair you with a reviewer, and merge your PR quickly.

Metadata

Metadata

Labels

GRANTFOX OSSGrantFox open-source campaignMAYBE REWARDEDEligible for GrantFox rewardOFFICIAL CAMPAIGNOfficial GrantFox campaign issuearea-contractsSmart contract (Soroban/Rust) worktype-testingTests and test coverage

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions