sim-cli 0.22.0

CLI tool for running and comparing Solana simulator backtests
Documentation
//! One module per `sim` subcommand: the clap arg struct and its entry point.

pub mod bundle;
pub mod compare;
pub mod datasets;
pub mod depth;
pub mod ranges;
pub mod run;
pub mod summarize;
pub mod update;
pub mod usage;

use eyre::Result;
use simulator_api::BundleBuildStatus;

/// Fails on a server job that won't produce its output: `failed`, or
/// `needs_investigation`, whose outcome is unknown. `job` names it in the error.
pub fn check_job(job: &str, request_id: &str, status: BundleBuildStatus) -> Result<()> {
    match status {
        BundleBuildStatus::Completed | BundleBuildStatus::InProgress => Ok(()),
        BundleBuildStatus::Failed => Err(eyre::eyre!("{job} {request_id} failed")),
        BundleBuildStatus::NeedsInvestigation => Err(eyre::eyre!(
            "{job} {request_id} needs investigation: its outcome is unknown, so don't assume it \
             succeeded"
        )),
    }
}