Skip to content

[contract] Add 3 Tests to market_tests.rs (Part 2)Β #533

@Olowodarey

Description

@Olowodarey

πŸ“‹ Overview

Expand test coverage for the market module by adding 3 new tests (Part 2 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: List Markets With Filters

#[test]
fn test_list_markets_with_filters() {
    // Create markets with different categories
    // List markets filtered by category
    // Verify only matching markets are returned
}

Test 2: Market Creator Fee

#[test]
fn test_market_creator_fee_collection() {
    // Create market with creator fee
    // Make predictions
    // Resolve market
    // Verify creator receives fee
}

Test 3: Private Market Access

#[test]
fn test_private_market_access_control() {
    // Create private market
    // Try to predict without invite
    // Should fail
    // Use invite code
    // Should succeed
}

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