feat: implemented get match predictions function#925
Merged
Conversation
…or a match Implements a public `get_match_predictions(match_id) -> Vec<Prediction>` view: reads the MatchPredictions(match_id) index of prediction IDs, loads each Prediction, and returns them in submission order. Matches with no predictions (and unknown match ids) return an empty Vec. Useful for analytics and displaying a match's prediction distribution. - prediction::get_match_predictions plus the contract entry point in lib.rs - integration tests: full retrieval, empty case, correct count, unknown match id Closes Arena1X#808 Arena1X#808 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Implements the core AI-oracle function that resolves a match and grades its predictions. submit_match_result(caller, match_id, winning_team): - requires the caller to be the stored AI agent and the contract to be unpaused - verifies the match exists, has not already been resolved, and has started (current time >= match_time) - validates winning_team is one of TEAM_A / TEAM_B / DRAW - records the result on the match (result_submitted, winning_team, submitted_by, submitted_at) and grades every prediction's is_correct field - emits a MatchResultSubmitted event - adds OracleError variants: Unauthorized, MatchNotFound, ResultAlreadySubmitted, MatchNotStarted, InvalidOutcome Integration tests cover AI-agent submission, non-agent rejection, submission before match time, duplicate submission, invalid outcome, unknown match, predictions graded correct/incorrect, all three outcomes, and a full prediction-to-scoring flow. Closes Arena1X#810 Arena1X#810 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@Divine-designs 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.
closes #808 and #810