refactor: Create dedicated oracles.rs module for centralized oracle management#123
Merged
greatest0fallt1me merged 3 commits intoJul 5, 2025
Merged
Conversation
…fy Hybrid contract, enhancing modularity and simplifying price retrieval logic
…luding Pyth and Reflector implementations, factory pattern for instance creation, and utility functions for price comparison and outcome determination
Contributor
|
Nicely done! Thanks for the PR, Keep the PRs coming @1nonlypiece |
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.
Pull Request Description
📋 Basic Information
Type of Change
Please select the type of change this PR introduces:
Related Issues
Related to Oracle management complexity and maintainability improvements
Closes #105
Priority Level
📝 Detailed Description
What does this PR do?
This PR refactors the Predictify Hybrid contract by creating a dedicated
oracles.rsmodule that centralizes all oracle-related code. Previously, oracle implementations, clients, and interfaces were mixed inlib.rs, making oracle management complex and hard to maintain.Why is this change needed?
The current state had oracle implementations, clients, and interfaces scattered throughout
lib.rs, creating:How was this tested?
Alternative Solutions Considered
lib.rswith better organization (rejected - still mixed concerns)no_stdenvironment)no_stdcompatibility)🏗️ Smart Contract Specific
Contract Changes
Please check all that apply:
Oracle Integration
Market Resolution Logic
Security Considerations
🧪 Testing
Test Coverage
Test Results
Manual Testing Steps
�� Documentation
Documentation Updates
Breaking Changes
Breaking Changes:
::new()method instead of direct field initializationOracleInstanceenum instead of trait objectsMigration Guide:
ReflectorOracle::new(contract_id)instead ofReflectorOracle { contract_id }OracleFactory::create_oracle()for dynamic oracle creation🔍 Code Quality
Code Review Checklist
Performance Impact
Security Review
🚀 Deployment & Integration
Deployment Notes
Integration Points
📊 Impact Assessment
User Impact
Business Impact
✅ Final Checklist
Pre-Submission
Review Readiness
🔗 Additional Resources
💬 Notes for Reviewers
Please pay special attention to:
no_stdcompatibilityQuestions for reviewers:
no_stdcompatibility?Thank you for your contribution to Predictify! 🚀