Skip to content

[Contract] — Implement Get Event Statistics Function#908

Merged
Olowodarey merged 2 commits into
Arena1X:mainfrom
Johnpii1:main
May 29, 2026
Merged

[Contract] — Implement Get Event Statistics Function#908
Olowodarey merged 2 commits into
Arena1X:mainfrom
Johnpii1:main

Conversation

@Johnpii1
Copy link
Copy Markdown
Contributor

close #819

Description
Added a new views module (contracts/creator-event-manager/src/views.rs) containing the EventStatistics contract type and get_event_statistics function that: loads the Event, iterates the event's match index to sum predictions and resolved results, counts verified winners, and computes completion booleans.
Exposed get_event_statistics on the contract API via CreatorEventManagerContract::get_event_statistics in src/lib.rs, mapping storage errors to the existing panic codes such as "event_not_found".
Added integration tests (contracts/creator-event-manager/tests/views_tests.rs) covering accuracy of counts, completion/winner-state transitions, and missing-event panic handling, and registered the test module in tests/mod.rs.

Testing
Ran cargo test for the creator-event-manager contract and all tests passed (including the new views_tests).
Ran cargo fmt --check which initially reported formatting differences outside the change set, and formatted the new/modified files with rustfmt to avoid unrelated repo-wide churn.

Johnpii1 added 2 commits May 29, 2026 21:55
…nction

Add event statistics view and expose `get_event_statistics`
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
insight-arena-4rll Ready Ready Preview, Comment May 29, 2026 9:06pm

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Johnpii1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Olowodarey Olowodarey merged commit 10977fc into Arena1X:main May 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Contract] — Implement Get Event Statistics Function

2 participants