test: fuzz dispute_open boundary cases#892
Merged
greatest0fallt1me merged 1 commit intoJul 24, 2026
Merged
Conversation
Add proptest-based fuzz target exercising dispute_open boundary conditions across stake amounts, market timing, anti-grief floors, duplicate disputes, and stake caps. Closes Predictify-org#739 Boundary conditions covered: - Stake: MIN_DISPUTE_STAKE (10_000_000), just below, just above, i128::MAX, zero, negative - Market timing: before end_time, after end_time, after dispute window closes - Duplicates: same user disputing twice - Stake caps: per-market per-user cap exceeded - Reason: None, empty Some, long string Update ethnum to 1.5.3 for Rust 1.80+ compatibility.
|
@chiprime 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! 🚀 |
Contributor
|
Merged into master via admin resolver (-X theirs). |
Contributor
|
Merging — great job on the clean implementation. 💯 |
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.
Summary
Add proptest-based fuzz target exercising
dispute_open(process_dispute) boundary conditions.Changes
New files
contracts/predictify-hybrid/fuzz/targets/dispute_open.rs: Cargo-fuzz target stub with documentation for future cargo-fuzz setupcontracts/predictify-hybrid/src/tests/dispute_open_fuzz.rs: Proptest-based fuzz target (main implementation, kept internal for crate API access)Modified files
contracts/predictify-hybrid/src/tests/mod.rs: Registered the newdispute_open_fuzzmoduleCargo.lock: Updatedethnumfrom 1.5.0 to 1.5.3 for Rust 1.80+ compatibilityBoundary conditions covered
MIN_DISPUTE_STAKE(10_000_000), just below, just above, i128::MAX, zero, negativeend_time, afterend_time, after dispute window closesNone, emptySome, long stringTesting
cargo test -p predictify-hybrid -- dispute_open_fuzzRuns 200 proptest cases per test to cover all boundary conditions (configurable via
ProptestConfig::with_cases).Security
mock_all_auths()is active (auth tested separately inrequire_auth_coverage_tests)unwrap()in production paths — errors propagated viaResulti128(overflow-checked in release profile)Closes #739