Skip to content

[Contract] — Test: get_platform_statistics increments correctly across multiple operations #1036

Description

@Olowodarey

Background

views::get_platform_statistics (src/views.rs) returns a PlatformStatistics
struct with counters for total events, matches, predictions, participants, and
fees. There is no integration test that drives all of these counters through
multiple operations and asserts each field.

Goal

Add a comprehensive test in tests/views_tests.rs that exercises all counters.

Tasks

  1. Start: call get_platform_statistics; assert all counters are 0.
  2. Create 2 events; assert total_events == 2.
  3. Add 2 matches to each event (4 total); assert total_matches == 4.
  4. Have 3 users join both events; submit predictions for each match; assert
  5. Assert total_participants >= 3 (unique participants).
  6. Assert total_fees_collected equals the sum of creation fees paid.

Acceptance Criteria

  • Each counter matches the expected cumulative value after each operation.

Files

contracts/creator-event-manager/tests/views_tests.rs.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions