Skip to content

[contract] Add 3 Tests to escrow_tests.rs (Part 1)Β #524

@Olowodarey

Description

@Olowodarey

πŸ“‹ Overview

Expand test coverage for the escrow module by adding 3 new tests (Part 1 of 2).

βœ… Tasks

  • Add 3 new test functions to contract/tests/escrow_tests.rs
  • Follow existing test patterns and helper functions
  • Verify all tests pass

πŸ§ͺ New Tests (3 total)

Test 1: Lock Stake Multiple Users

#[test]
fn test_lock_stake_multiple_users() {
    // Lock stakes for multiple users
    // Verify each user's balance is tracked separately
    // Verify total locked amount is correct
}

Test 2: Release Payout Partial Amount

#[test]
fn test_release_payout_partial_amount() {
    // Lock stake
    // Release partial payout
    // Verify remaining locked balance
    // Release rest
    // Verify balance is zero
}

Test 3: Lock Stake Insufficient Balance

#[test]
fn test_lock_stake_insufficient_balance() {
    // Try to lock more than user has
    // Should fail with insufficient balance error
}

πŸ” Verification

  • All 3 tests written
  • All tests pass
  • Tests follow existing patterns
  • No clippy warnings

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions