Skip to content

refactor: add edge_cases and improve code structure in various modules#174

Merged
greatest0fallt1me merged 3 commits into
Predictify-org:masterfrom
pushkarm029:edge-case
Oct 1, 2025
Merged

refactor: add edge_cases and improve code structure in various modules#174
greatest0fallt1me merged 3 commits into
Predictify-org:masterfrom
pushkarm029:edge-case

Conversation

@pushkarm029

Copy link
Copy Markdown
Contributor

Pull Request Description

📋 Basic Information

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🧪 Test addition/update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🔒 Security fix
  • 🎨 UI/UX improvement
  • 🚀 Deployment/Infrastructure change

Related Issues

Closes #91

Priority Level

  • 🟢 Medium (moderate impact)

📝 Detailed Description

  • Cleaned up unused imports and reordered them for better readability in admin.rs, batch_operations.rs, circuit_breaker.rs, fees.rs, markets.rs, oracles.rs, resolution.rs, and voting.rs.
  • Enhanced test organization and structure in batch_operations_tests.rs and circuit_breaker_tests.rs for improved clarity and maintainability.
  • Introduced a new module edge_cases.rs for comprehensive edge case management in the Predictify Hybrid contract, including handling zero stakes, tie-breaking, orphaned markets, and partial resolutions.
  • Updated lib.rs to integrate edge case handling functions, enhancing the contract's robustness against edge scenarios.

Thank you for your contribution to Predictify! 🚀

…dules

- Cleaned up unused imports and reordered them for better readability in `admin.rs`, `batch_operations.rs`, `circuit_breaker.rs`, `fees.rs`, `markets.rs`, `oracles.rs`, `resolution.rs`, and `voting.rs`.
- Enhanced test organization and structure in `batch_operations_tests.rs` and `circuit_breaker_tests.rs` for improved clarity and maintainability.
- Introduced a new module `edge_cases.rs` for comprehensive edge case management in the Predictify Hybrid contract, including handling zero stakes, tie-breaking, orphaned markets, and partial resolutions.
- Updated `lib.rs` to integrate edge case handling functions, enhancing the contract's robustness against edge scenarios.

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
@pushkarm029 pushkarm029 changed the title refactor: reorganize imports and improve code structure in various modules refactor: add edge_cases and improve code structure in various modules Sep 28, 2025
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

@pushkarm029 Please resolve the conflicts

- 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>
@pushkarm029

Copy link
Copy Markdown
Contributor Author

@greatest0fallt1me conflicts resolved. please have a look.

@greatest0fallt1me

Copy link
Copy Markdown
Contributor

@pushkarm029 Thanks for the contribution, great job!

@greatest0fallt1me greatest0fallt1me merged commit 9bb0d4d into Predictify-org:master Oct 1, 2025
1 check passed
@pushkarm029 pushkarm029 deleted the edge-case branch October 5, 2025 10:00
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 Edge Case Handling for Zero Stakes, Ties, and Orphaned Markets

2 participants