Skip to content

Add zero-value edge case tests for deposits and withdrawals #12

Description

@Code-Paragon

Problem

The CONTRIBUTING.md strictly mandates testing for zero-value edge cases, but test.rs currently only tests standard positive values (e.g., 1000 and 500).

Expected behavior

New test cases are added to explicitly pass 0 and negative integers into the deposit and withdraw methods to verify the amount > 0 assertions trigger correctly.

Files to update

  • src/test.rs

Project relevance

This satisfies the strict testing requirements outlined for contributors and prevents potential accounting manipulation vectors in the Vault.

Acceptance criteria

  • Feature works as described
  • Tests are added or updated where needed
  • Documentation is updated where needed
  • Explicit test cases verify that deposit(&user, &0) panics with the strictly positive error message
  • No TypeScript, lint, test, or build errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions