Skip to content

Add MAX_AMOUNT and MIN_AMOUNT boundary tests for create_vault in tests/proptest_amounts.rs #231

Description

@1nonlypiece

📌 Description

create_vault enforces MIN_AMOUNT ≤ amount ≤ MAX_AMOUNT. Snapshots like
test_amount_below_minimum, test_amount_above_maximum, and
test_amount_exactly_max_allowed exist, but tests/proptest_amounts.rs should
densely cover both exact boundaries and the just-inside/just-outside neighbours,
all returning Error::InvalidAmount on rejection.

Goal: extend the amount property tests so MIN_AMOUNT and MAX_AMOUNT are
accepted, MIN_AMOUNT - 1 and MAX_AMOUNT + 1 are rejected, with randomized
sampling across the valid interior.

🎯 Requirements and Context

  • Must be deterministic under a fixed proptest seed.
  • Assert exact boundary acceptance and neighbour rejection with Error::InvalidAmount.
  • Mint sufficient USDC so rejections come from the amount check, not a balance
    failure (distinguish InvalidAmount from "balance is not sufficient").
  • Cover zero and negative amounts explicitly.

🛠️ Suggested Execution

1. Fork the repo and create a branch

git checkout -b feature/amount-boundary-proptests

2. Implement changes

  • Tests: extend tests/proptest_amounts.rs with boundary strategies and explicit
    edge vectors at MIN_AMOUNT, MAX_AMOUNT, and their neighbours.
  • Docs: add an "Amount Bounds" section to TESTING_GUIDE.md.

3. Test and commit

  • Run cargo test and regenerate coverage.
  • Cover edge cases: MIN_AMOUNT, MIN_AMOUNT - 1, MAX_AMOUNT, MAX_AMOUNT + 1,
    0, negative.

Example commit message

test: amount boundary property coverage for create_vault

✅ Guidelines

  • Minimum 95% test coverage on the amount-validation branches.
  • Clear documentation of the boundary cases.
  • 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

Assignees

No one assigned

    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