Skip to content

[contract] Add 3 Tests to oracle_tests.rsΒ #534

@Olowodarey

Description

@Olowodarey

πŸ“‹ Overview

Expand test coverage for the oracle module by adding 3 new tests.

βœ… Tasks

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

πŸ§ͺ New Tests (3 total)

Test 1: Resolve Market With Invalid Outcome

#[test]
fn test_resolve_market_invalid_outcome() {
    // Create market with outcomes ["yes", "no"]
    // Try to resolve with outcome "maybe"
    // Should fail with invalid outcome error
}

Test 2: Resolve Already Resolved Market

#[test]
fn test_resolve_already_resolved_market() {
    // Create and resolve market
    // Try to resolve again
    // Should fail with already resolved error
}

Test 3: Resolve Market Before Resolution Time

#[test]
fn test_resolve_market_too_early() {
    // Create market with resolution_time in future
    // Try to resolve before resolution_time
    // Should fail with too early 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