feat: implement list_event_matches function#915
Merged
Olowodarey merged 1 commit intoMay 30, 2026
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
list_event_matches(env, event_id)tomatch.rs— retrieves all matches for an event from theEventMatches(event_id)index, fetches eachMatchstruct, and returns them sorted bymatch_timeascendinglib.rs, returningVec<Match>and panicking with"event_not_found"for unknown event IDsmatch_tests.rs: returns all matches for event, empty list for event with no matches, matches sorted by time, non-existent event panicsTest plan
test_list_event_matches_returns_all_matches— all 3 added matches are returnedtest_list_event_matches_empty_for_new_event— empty Vec for an event with no matchestest_list_event_matches_sorted_by_match_time_ascending— matches inserted out of order are returned in chronological ordertest_list_event_matches_nonexistent_event_panics— panics withevent_not_foundfor a missing event IDCloses #802
Closes #801