Skip to content

test/event-creation-tests#213

Closed
rosemary21 wants to merge 432 commits into
Predictify-org:masterfrom
rosemary21:test/event-creation-tests
Closed

test/event-creation-tests#213
rosemary21 wants to merge 432 commits into
Predictify-org:masterfrom
rosemary21:test/event-creation-tests

Conversation

@rosemary21

Copy link
Copy Markdown

Pull Request Description

Summary
Rust has been set up and all 36 event creation tests pass.

Test Results
All new tests pass when run with single-threaded execution:

cargo test test::test_event -- --test-threads=1 # 25 passed
cargo test test::test_edge_case -- --test-threads=1 # 8 passed
cargo test test::test_event_creation_all_comparison_operators -- --test-threads=1 # 1 passed
Total: 36 new tests passing ✓

Coverage Note
cargo-tarpaulin couldn't be installed because it requires OpenSSL. To install it:

brew install openssl pkg-config
export OPENSSL_DIR=$(brew --prefix openssl)
cargo install cargo-tarpaulin
Test Execution
The segfault that occurs during parallel test execution is a known issue with Soroban's WASM test environment, not a problem with the tests. To run tests reliably:

cargo test -- --test-threads=1
Files Modified
[test.rs:744-2196]- Added 36 comprehensive event creation tests covering:
Successful event creation (3 tests)
Admin-only access security (3 tests)
Parameter validation (6 tests)
Event ID uniqueness (3 tests)
Event storage (3 tests)
Event emission (2 tests)
Edge cases (8 tests)
Market state (2 tests)
Comparison operators (1 test)
Integration (3 tests)
Isolation (1 test)

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

@rosemary21 Please resolve the conflicts

1nonlypiece and others added 27 commits January 29, 2026 05:57
…with new methods for initialization, updating, and resetting configurations
…sistency in Predictify Hybrid contract configuration
…tion, updating, validation, and environment detection in Predictify Hybrid contract
… contract, including time, string, numeric, validation, conversion, common helper, and testing utilities
…viding various helper utilities for time, string, numeric operations, validation, conversion, and testing
…tract for enhanced time, string, numeric operations, and validation
…umeric operations, validation, and performance in Predictify Hybrid contract
… to use alloc::string for string manipulation and simplify time formatting
…ontract by removing unnecessary Env parameter and using references for numeric operations
… to remove unnecessary Env parameter and use references for improved clarity and consistency
…improving parameter handling, simplifying logic, and optimizing string manipulations for better performance and readability
…acing map and unwrap with direct indexing for improved performance and readability
…g direct indexing, enhancing performance and code clarity
…act, including event types, emission utilities, logging, validation, and testing functionalities
…g event emission, logging, validation, and testing utilities
…istency and brevity, enhancing event emission and logging functionality
…Hybrid contract, including retrieval, validation, and testing of events, enhancing overall event handling capabilities
…g comprehensive validation, retrieval, and performance metrics checks to ensure robust event handling
… contract, including market creation, state validation, vote inputs, oracle configuration, fee configuration, and dispute creation, enhancing input integrity and error handling
…act, covering address, string length, number range, positive numbers, future timestamps, and market creation, ensuring robust error handling and data integrity
…id contract, including input validation, market creation, oracle configuration, fee validation, and dispute handling, ensuring robust error management and data integrity
…ct references for event creation and duration validation, ensuring accurate input handling and improved test reliability
… advanced modules

- Fix brace mismatch in lib.rs that was causing compilation errors
- Temporarily disable advanced modules (config, events, extensions, fees, resolution, utils, validation) to get core functionality working
- Core features working: market creation, voting, oracle integration, basic disputes
- Advanced features will be re-enabled after proper implementation

Core functionality available:
- create_market: Create prediction markets with oracle configuration
- vote: Users can stake tokens on market outcomes
- fetch_oracle_result: Fetch prices from Reflector oracle
- dispute_result: Users can dispute market outcomes
- resolve_market: Combine oracle and community consensus
- claim_winnings: Winners can claim their rewards
- collect_fees: Platform fee collection
pushkarm029 and others added 27 commits January 29, 2026 05:57
- Change validation conditions in GovernanceContract to check for zero values instead of negative values for voting period and quorum votes.
- Refactor function signatures in PredictifyHybrid and ContractMonitor for improved readability by aligning parameters.
- Clean up imports and formatting in monitoring and versioning modules for consistency and clarity.

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Resolved conflict in events.rs by merging both sets of changes:
- Kept event emission implementations (StateChangeEvent, WinningsClaimedEvent)
- Kept upgrade manager events (ContractUpgradedEvent, ContractRollbackEvent, UpgradeProposalCreatedEvent)

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
- Add comprehensive market analytics module with detailed statistics
- Implement get_market_statistics function for market data analysis
- Add get_voting_analytics function for participation metrics
- Create get_oracle_performance_stats function for oracle monitoring
- Implement get_fee_analytics function for revenue tracking
- Add get_dispute_analytics function for dispute resolution metrics
- Create get_participation_metrics function for user engagement analysis
- Implement get_market_comparison_analytics function for comparative analysis
- Add comprehensive data structures for analytics results
- Include helper functions for volatility, consensus, and engagement calculations
- All functions include detailed documentation and examples
- Successfully tested with cargo build and cargo test
- Add performance_benchmarks module with comprehensive benchmarking capabilities
- Implement BenchmarkResult, PerformanceBenchmarkSuite, and related data structures
- Add public functions for gas usage, storage usage, oracle performance, batch operations, and scalability benchmarking
- Include performance report generation and threshold validation
- Fix function name length issue by renaming benchmark_oracle_call_performance to benchmark_oracle_performance
- Resolve compilation errors with Soroban SDK compatibility
- All tests pass successfully
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
- Add .env, .env.*, and *.env patterns to prevent committing secrets
- Follows security best practices for environment variable management
- Add clear 1-2 paragraph project description (what it does + who it's for)
- Add complete setup instructions (requirements, install, env setup, run, test, network)
- Add helpful links (docs, repo structure, contribution guidelines)
- Add Quick Start section for immediate onboarding
- Add comprehensive Table of Contents
- Add detailed Development, Testing, and Deployment sections
- Add Security, Monitoring, and Support sections
- Improve project structure documentation
- Add contribution guidelines and development workflow
@rosemary21 rosemary21 closed this Jan 29, 2026
@rosemary21 rosemary21 force-pushed the test/event-creation-tests branch from 98b0b8a to 14adaa0 Compare January 29, 2026 13:59
Martinsandre007 pushed a commit to Martinsandre007/predictify-contracts that referenced this pull request Mar 27, 2026
feature:Missing Betting Lock During Active Resolution
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.