test: add per-entrypoint auth snapshots for resolution entrypoints (#…#1013
Merged
greatest0fallt1me merged 1 commit intoJul 26, 2026
Conversation
…redictify-org#977) Snapshot the auth subject recorded by the Soroban host for every resolution entrypoint of PredictifyHybrid: Admin-auth (committed snapshot): - resolve_market_manual - resolve_market_with_ties - force_resolve_market - admin_override_verification - set_resolution_cooldown Permissionless (committed snapshot): - fetch_oracle_result - distribute_payouts Read-only (committed snapshot): - get_resolution_analytics - get_verified_result - is_result_verified Caller-auth / deprecated (auth boundary): - resolve_market - verify_result - verify_result_with_retry Includes edge-case tests: no-auth panics for admin entrypoints, non-admin Unauthorized rejections, and auth-subject isolation checks ensuring only the declared admin address is authenticated.
|
@baling-1 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! 🚀 |
greatest0fallt1me
merged commit Jul 26, 2026
a9ba796
into
Predictify-org:master
0 of 2 checks passed
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.
test: add per-entrypoint auth snapshots for resolution entrypoints
Problem
Resolution entrypoints (resolve_market_manual, force_resolve_market, distribute_payouts, etc.) had no auth snapshot coverage, unlike bets, voting, and disputes which already had per-entrypoint test suites. Without these tests, regressions that accidentally require or skip authorization checks on resolution paths would go undetected.
What this PR adds
contracts/predictify-hybrid/tests/auth_snapshot_resolution.rs — 23 tests covering every resolution entrypoint in PredictifyHybrid.
Entrypoint matrix
Category Entrypoints Auth assertion
Admin auth (committed snapshot) resolve_market_manual, resolve_market_with_ties, force_resolve_market, admin_override_verification, set_resolution_cooldown env.auths() records the admin address
Permissionless (committed snapshot) fetch_oracle_result, distribute_payouts No auth recorded
Read-only (committed snapshot) get_resolution_analytics, get_verified_result, is_result_verified No auth recorded
Deprecated / caller auth (auth boundary) resolve_market, verify_result, verify_result_with_retry Call passes require_auth
Edge-case coverage
Design decisions
Testing
cargo test --test auth_snapshot_resolution
Note: The library currently has pre-existing compilation errors on master (870 errors from duplicate method definitions, missing imports, and duplicate enum variants across recent merge commits). This blocks local test execution but is unrelated to this change. The new test file introduces zero additional errors.
Closes Add per-entrypoint auth snapshot test for resolution #977