Skip to content

feat: implement list_event_matches function#915

Merged
Olowodarey merged 1 commit into
Arena1X:mainfrom
daniella-techie:feature/802-801-list-event-matches
May 30, 2026
Merged

feat: implement list_event_matches function#915
Olowodarey merged 1 commit into
Arena1X:mainfrom
daniella-techie:feature/802-801-list-event-matches

Conversation

@daniella-techie
Copy link
Copy Markdown
Contributor

Summary

  • Add list_event_matches(env, event_id) to match.rs — retrieves all matches for an event from the EventMatches(event_id) index, fetches each Match struct, and returns them sorted by match_time ascending
  • Expose the function via the contract's public interface in lib.rs, returning Vec<Match> and panicking with "event_not_found" for unknown event IDs
  • Four unit tests added to match_tests.rs: returns all matches for event, empty list for event with no matches, matches sorted by time, non-existent event panics

Test plan

  • test_list_event_matches_returns_all_matches — all 3 added matches are returned
  • test_list_event_matches_empty_for_new_event — empty Vec for an event with no matches
  • test_list_event_matches_sorted_by_match_time_ascending — matches inserted out of order are returned in chronological order
  • test_list_event_matches_nonexistent_event_panics — panics with event_not_found for a missing event ID

Closes #802
Closes #801

Add list_event_matches to match.rs that retrieves all matches for a
given event, sorted by match_time ascending. Exposes the function via
the contract's public interface and validates that the event exists
before reading its match list. Unit tests cover the full result set,
empty events, sort order, and the non-existent event error path.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 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 30, 2026 12:03pm

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@daniella-techie 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 cc6f8d1 into Arena1X:main May 30, 2026
4 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 List Event Matches Function [Contract] — Implement Get Match Function

2 participants