Skip to content

test: require_auth coverage matrix as denylist#792

Open
Cent-Dave wants to merge 1 commit into
Predictify-org:masterfrom
Cent-Dave:test/require-auth-matrix
Open

test: require_auth coverage matrix as denylist#792
Cent-Dave wants to merge 1 commit into
Predictify-org:masterfrom
Cent-Dave:test/require-auth-matrix

Conversation

@Cent-Dave

@Cent-Dave Cent-Dave commented Jun 29, 2026

Copy link
Copy Markdown

closes #626

PR Draft

Title
test: require_auth coverage matrix as denylist

Body

Summary

Add a require_auth coverage matrix to require_auth_coverage_tests.rs to enforce that every state-mutating public entrypoint records the expected Soroban require_auth call.

What changed

  • Added a denylist-style meta-test section at the bottom of require_auth_coverage_tests.rs
  • Implemented helper assert_auth_recorded
  • Added per-entrypoint meta-tests:
    • meta_vote_records_user_auth
    • meta_place_bet_records_user_auth
    • meta_cancel_bet_records_user_auth
    • meta_claim_winnings_records_user_auth
    • meta_dispute_market_records_user_auth
    • meta_vote_on_dispute_records_user_auth
    • meta_create_market_records_admin_auth
    • meta_resolve_market_manual_records_admin_auth
    • meta_set_platform_fee_records_admin_auth
    • meta_set_treasury_records_admin_auth
    • meta_set_global_claim_period_records_admin_auth
    • meta_set_market_claim_period_records_admin_auth
    • meta_sweep_unclaimed_winnings_records_admin_auth
    • meta_extend_deadline_records_admin_auth
    • meta_collect_fees_records_admin_auth
    • meta_withdraw_collected_fees_records_admin_auth
    • meta_archive_event_records_admin_auth
    • meta_add_admin_records_admin_auth
    • meta_remove_admin_records_admin_auth
    • meta_update_admin_role_records_admin_auth
    • meta_request_resume_records_admin_auth
    • meta_refund_on_oracle_failure_records_admin_auth
    • meta_clear_monitor_overflow_records_admin_auth
    • meta_set_global_bet_limits_records_admin_auth
    • meta_set_oracle_val_cfg_global_records_admin_auth
    • meta_admin_override_verification_records_admin_auth
    • meta_update_event_description_records_admin_auth
  • Added exhaustive denylist test:
    • test_exhaustive_mutating_entrypoint_auth_denylist
  • Enabled require_auth_coverage_tests in lib.rs
  • Removed duplicate module declaration in lib.rs

Why

This adds a CI-safe guard so new mutating entrypoints cannot be added without a corresponding auth check being verified by tests.

Testing

Run locally from repo root:

cargo test -p predictify-hybrid require_auth_coverage_tests -- --nocapture

Notes

  • cargo was not available in the current environment for verification, so the branch and commit were created and pushed, but the test run should be completed locally.

Add meta-tests to require_auth_coverage_tests.rs that enforce every
state-mutating entrypoint in lib.rs calls require_auth for the expected
signer (user or admin). Includes per-function meta_* tests and a single
exhaustive denylist test as the canonical CI gate.
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Cent-Dave 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

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.

Add lib.rs entrypoint require_auth coverage matrix to require_auth_coverage_tests

1 participant