Skip to content

test(betting): add per-entrypoint auth snapshot suite for betting - #1019

Merged
greatest0fallt1me merged 1 commit into
Predictify-org:masterfrom
Vicistar-V:task/betting-authsnap
Jul 26, 2026
Merged

test(betting): add per-entrypoint auth snapshot suite for betting#1019
greatest0fallt1me merged 1 commit into
Predictify-org:masterfrom
Vicistar-V:task/betting-authsnap

Conversation

@Vicistar-V

Copy link
Copy Markdown
Contributor

Summary

Creates contracts/predictify-hybrid/tests/auth_snapshot_betting.rs — a dedicated auth snapshot suite covering 22 betting-related entrypoints not previously tested in auth_snapshot.rs.

Write entrypoints (11)

Entrypoint Auth subject Method
place_bets user committed snapshot
cancel_event admin auth boundary
refund_on_oracle_failure admin auth boundary
distribute_payouts none (public) committed snapshot
set_global_bet_limits admin committed snapshot
set_event_bet_limits admin committed snapshot
set_market_max_bet_cap admin committed snapshot
remove_market_max_bet_cap admin committed snapshot
set_governance_min_bet_bps admin committed snapshot
commit_fee_config admin auth boundary
withdraw_collected_fees admin auth boundary

Read-only entrypoints (8)

get_bet, has_user_bet, get_implied_probability, get_payout_multiplier, get_effective_bet_limits, get_market_max_bet_cap, calculate_bet_payout, query_user_bets_paged — all verified to require no auth.

Edge cases (4)

Non-admin rejection tests for set_global_bet_limits, set_market_max_bet_cap, cancel_event, commit_fee_config.

No-auth tests (4)

#[should_panic] tests proving require_auth fires for cancel_event, refund_on_oracle_failure, commit_fee_config, withdraw_collected_fees.

Notes

  • reveal_fee_config omitted because fees::FeeConfig is in a private module. Admin-only auth is guaranteed by the same require_primary_admin call shared with commit_fee_config.
  • Path adapted from contracts/betting/tests/auth_snap.rs (issue spec) to the monolithic predictify-hybrid/tests/ structure.

Test Plan

  • Registered in Cargo.toml as [[test]] name = "auth_snapshot_betting"
  • Follows existing auth_snapshot.rs patterns and fixture structure

Closes #866

Covers 22 betting-related entrypoints not previously tested in
auth_snapshot.rs:

Write entrypoints (11): place_bets, cancel_event,
refund_on_oracle_failure, distribute_payouts, set_global_bet_limits,
set_event_bet_limits, set_market_max_bet_cap, remove_market_max_bet_cap,
set_governance_min_bet_bps, commit_fee_config, withdraw_collected_fees

Read-only entrypoints (8): get_bet, has_user_bet,
get_implied_probability, get_payout_multiplier, get_effective_bet_limits,
get_market_max_bet_cap, calculate_bet_payout, query_user_bets_paged

Edge cases (4): non-admin rejection for set_global_bet_limits,
set_market_max_bet_cap, cancel_event, commit_fee_config

No-auth tests (4): should_panic tests for cancel_event,
refund_on_oracle_failure, commit_fee_config, withdraw_collected_fees

Note: reveal_fee_config omitted because fees::FeeConfig is in a private
module. Admin-only auth is guaranteed by the same require_primary_admin
call shared with commit_fee_config.

Refs Predictify-org#866
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

@Vicistar-V 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

@greatest0fallt1me
greatest0fallt1me merged commit 92351a3 into Predictify-org:master Jul 26, 2026
0 of 2 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.

Add per-entrypoint auth snapshot test for betting (buffer #10)

2 participants