Skip to content

Add comprehensive tests for vesting_escrow contract edge cases #554

Description

@Wilfred007

What

Only one test covers the entire vesting contract. Missing tests for: double init, claim before cliff, claim when fully claimed, clawback by non-admin, zero-amount init, duration < cliff, multiple partial claims.

Why

The single test doesn't verify error paths. The panic! error paths are completely untested.

Scope

In scope: Tests for all error variants, boundary conditions, authorization checks
Out of scope: Fuzzing, property tests

Acceptance Criteria

  • Test: double initialization rejected
  • Test: claim before cliff fails
  • Test: unauthorized clawback rejected
  • Test: zero-amount init rejected
  • Test: multiple partial claims work

Technical Context

  • contracts/vesting_escrow/src/test.rs — only 1 test (114 lines)
  • contracts/bulk_payment/src/test.rs — good test pattern reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaigncontractSmart Contract developmentmediumModerate tasks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions