Skip to content

feat: implemented get match predictions function#925

Merged
Olowodarey merged 2 commits into
Arena1X:mainfrom
Divine-designs:feat/divine-insightarena
Jun 2, 2026
Merged

feat: implemented get match predictions function#925
Olowodarey merged 2 commits into
Arena1X:mainfrom
Divine-designs:feat/divine-insightarena

Conversation

@Divine-designs
Copy link
Copy Markdown
Contributor

@Divine-designs Divine-designs commented Jun 2, 2026

closes #808 and #810

Divine-designs and others added 2 commits June 2, 2026 01:49
…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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 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 Jun 2, 2026 12:54am

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

@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! 🚀

Learn more about application limits

@Divine-designs Divine-designs changed the title feat: insightarena feat: implemented get match predictions function Jun 2, 2026
@Olowodarey Olowodarey merged commit 81ba5b8 into Arena1X:main Jun 2, 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 Get Match Predictions Function

2 participants