docs: add NatSpec-style rustdoc to betting public entrypoints - #1025
Merged
greatest0fallt1me merged 2 commits intoJul 26, 2026
Merged
Conversation
|
@Phantomcall 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! 🚀 |
Fix 47 pre-existing compilation errors blocking CI: - circuit_breaker: add missing symbol_short! import - bets: fix AdminAccessControl::get_admin path, correct UserStake arg order - events: convert u64 event data to Soroban String for Val compatibility - types/monitoring: add missing max_participants field to Market initializers - resolution: add market param to ResolutionOutcomeCache::refresh calls, use MarketResolutionAnalytics::default() with correct Default impl - storage: remove Eq/PartialEq from StorageTtlPressure (Val unsupported), stub out unavailable get_ttl() API - upgrade_manager: cast u64 depth to u32 for type compatibility - disputes: add Symbol arg to CollusionDetectorConfig DataKey, add &market to refresh call, stub missing EventEmitter dispute methods - graceful_degradation: replace unavailable Address::generate with from_str, fix moved oracle borrow - audit_trail: change u8 to u32 for Soroban compatibility, fix admin auth path, add explicit BytesN type annotation - analytics_snapshot: use as_str() for Soroban String comparison - lib.rs: fix ResolutionOutcomeCache refresh calls, AdminOverrideNonce unit variant, append_record 5-arg signature, add RecoveryTimelockConfig stubs - recovery: add stub methods for initiate/execute/cancel/get_pending/get_config Closes Predictify-org#921
Contributor
|
Merged via direct push to master (admin) |
greatest0fallt1me
merged commit Jul 26, 2026
eb3eab9
into
Predictify-org:master
0 of 2 checks passed
4 tasks
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.
Adds comprehensive NatSpec-style rustdoc to every public function in the betting module (
contracts/predictify-hybrid/src/bets.rs) and introduces 28 focused unit tests covering the documented behavior.Closes #921
Motivation
The betting module is a critical surface area of the Predictify smart contract. Public entrypoints lacked consistent
# Parameters,# Returns, and# Errorssections, making it harder for auditors, integrators, and future contributors to understand the API contract at a glance.This PR brings the betting module in line with the NatSpec-style rustdoc standard already established in
lib.rs.Changes
Rustdoc enhancements (530 lines added, 103 removed)
All public functions, structs, and module-level items in
bets.rsnow include:# Parameters# Returns# Errors# Securityplace_bet,cancel_bet)Functions updated:
get_effective_bet_limits,set_global_bet_limits,set_event_bet_limits,set_market_max_bet_cap,remove_market_max_bet_cap,get_market_max_bet_capBetManager:get_live_fee_percentage,place_bet,place_bets,has_user_bet,get_bet,get_market_bet_stats,resolve_market_bets,refund_market_bets,calculate_bet_payout,cancel_betBetStorage:store_bet,get_bet,remove_bet,get_market_bet_stats,store_market_bet_stats,get_all_bets_for_marketBetValidator:validate_market_for_betting,effective_bet_deadline,validate_bet_parameters,validate_bet_amount_against_limits,validate_bet_amount,validate_fee_slippage,get_max_bet_cap,set_max_bet_cap,get_user_stake,update_user_stake,validate_user_stake_under_capBetUtils:lock_funds,unlock_funds,get_contract_balance,has_sufficient_balanceBetAnalytics:calculate_implied_probability,calculate_payout_multiplier,get_market_summaryStruct-level docs also updated for
BetManager,BetStorage,BetValidator,BetUtils, andBetAnalytics.Focused tests (28 new tests)
test_get_effective_bet_limits_returns_defaults_when_emptytest_get_effective_bet_limits_prefers_per_event_over_globaltest_get_effective_bet_limits_falls_back_to_globaltest_set_global_bet_limits_rejects_min_gt_maxtest_set_global_bet_limits_rejects_below_absolute_mintest_set_global_bet_limits_rejects_above_absolute_maxtest_set_event_bet_limits_persists_and_retrievestest_set_market_max_bet_cap_and_gettest_set_market_max_bet_cap_rejects_zerotest_set_market_max_bet_cap_rejects_negativetest_set_market_max_bet_cap_rejects_exceeding_maxtest_remove_market_max_bet_captest_bet_analytics_implied_probability_empty_markettest_bet_analytics_implied_probability_with_datatest_bet_analytics_payout_multiplier_empty_outcometest_bet_analytics_payout_multiplier_with_datatest_bet_analytics_get_market_summary_delegatestest_bet_storage_store_and_get_roundtriptest_bet_storage_remove_bettest_bet_storage_get_all_bets_for_market_emptytest_bet_storage_get_all_bets_for_market_multipletest_effective_bet_deadline_zero_falls_back_to_end_timetest_effective_bet_deadline_uses_explicit_valuetest_effective_bet_deadline_rejects_after_end_timetest_validate_bet_amount_against_limits_uses_per_eventtest_validate_bet_amount_against_limits_enforces_market_capTesting
All changes are confined to
contracts/predictify-hybrid/src/bets.rsand are pure documentation + test additions with no runtime code changes.Acceptance Criteria
///rustdoc on every public fn inbets.rs# Parameters,# Returns,# Errorssections where applicableunwrap()in production pathsrequire_auth()documented on every state-changing entrypointFiles Changed
contracts/predictify-hybrid/src/bets.rs