pub struct OracleDetector;
Expand description
Detector for identifying oracle usage in Solana programs
Implementations§
Source§impl OracleDetector
impl OracleDetector
Sourcepub fn scan_project(
path: &str,
verbose: bool,
) -> Result<OracleReport, MigrationError>
pub fn scan_project( path: &str, verbose: bool, ) -> Result<OracleReport, MigrationError>
Scans a Solana project for oracle usage and generates a detailed report.
This function analyzes the project’s source code and dependencies to detect any oracle integrations, such as Pyth, Switchboard, or Chainlink.
§Arguments
path
- Path to the root directory of the Solana projectverbose
- Whether to enable verbose output during scanning
§Returns
A Result
containing an OracleReport
with the scan results, or a MigrationError
if the scan fails.
§Examples
use soon_migrate::oracle::OracleDetector;
let report = OracleDetector::scan_project("./my_project", true).unwrap();
println!("Found {} oracle usages", report.detected_oracles.len());
Sourcepub fn print_report(report: &OracleReport, verbose: bool)
pub fn print_report(report: &OracleReport, verbose: bool)
Print a formatted oracle detection report
§Arguments
report
- The oracle report to printverbose
- Whether to include detailed information
Sourcepub fn print_integration_guide(report: &OracleReport)
pub fn print_integration_guide(report: &OracleReport)
Print the APRO integration guide if available
§Arguments
report
- The oracle report containing the guide
Auto Trait Implementations§
impl Freeze for OracleDetector
impl RefUnwindSafe for OracleDetector
impl Send for OracleDetector
impl Sync for OracleDetector
impl Unpin for OracleDetector
impl UnwindSafe for OracleDetector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more