Skip to content

[contract] Add 3 Tests to leaderboard_tests.rs (Part 2)Β #529

@Olowodarey

Description

@Olowodarey

πŸ“‹ Overview

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

βœ… Tasks

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

πŸ§ͺ New Tests (3 total)

Test 1: Leaderboard Season Transition

#[test]
fn test_leaderboard_season_transition() {
    // Add entries to season 1
    // Start season 2
    // Add entries to season 2
    // Verify season 1 entries are preserved
    // Verify season 2 entries are separate
}

Test 2: Leaderboard Rewards Distribution

#[test]
fn test_leaderboard_rewards_distribution() {
    // Add entries with scores
    // Distribute rewards to top N
    // Verify correct users receive rewards
    // Verify amounts are proportional to rank
}

Test 3: Empty Leaderboard Query

#[test]
fn test_get_leaderboard_empty_season() {
    // Query leaderboard for season with no entries
    // Should return empty list, not 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