Skip to content

[contract] Add 3 Tests to market_tests.rs (Part 1)Β #532

@Olowodarey

Description

@Olowodarey

πŸ“‹ Overview

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

βœ… Tasks

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

πŸ§ͺ New Tests (3 total)

Test 1: Create Market With Multiple Outcomes

#[test]
fn test_create_market_multiple_outcomes() {
    // Create market with 3+ outcomes
    // Verify all outcomes are stored
    // Verify predictions can be made on any outcome
}

Test 2: Market Expiration

#[test]
fn test_market_expiration() {
    // Create market with end_time
    // Advance time past end_time
    // Try to make prediction
    // Should fail with market expired error
}

Test 3: Cancel Market

#[test]
fn test_cancel_market() {
    // Create market with predictions
    // Cancel market
    // Verify market is marked cancelled
    // Verify refunds are processed
}

πŸ” 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