Skip to main content

mollusk_svm_result/
lib.rs

1//! SVM program execution results and validation.
2//!
3//! This crate provides types and utilities for working with the results of
4//! SVM program execution, including validation and comparison capabilities.
5//!
6//! # Core Types
7//!
8//! * [`InstructionResult`] - The main result type containing execution details
9//! * [`ProgramResult`] - The program's execution outcome (success/failure)
10//! * [`ContextResult`] - Result type for use with `MolluskContext`
11//!
12//! # Validation
13//!
14//! * [`Check`] - Validate individual instruction results
15//! * [`Compare`] - Compare two instruction results
16//! * [`Config`] - Configuration for validation behavior
17//! * [`CheckContext`] - Context trait for custom validation logic
18//!
19//! # Example
20//!
21//! ```rust,ignore
22//! use mollusk_svm_result::{Check, Config, InstructionResult};
23//!
24//! let result = InstructionResult::default();
25//! let checks = vec![Check::success(), Check::compute_units(100)];
26//! let config = Config::default();
27//!
28//! result.run_checks(&checks, &config, &mollusk);
29//! ```
30
31pub mod check;
32pub mod compare;
33pub mod config;
34#[cfg(feature = "fuzz")]
35pub mod fuzz;
36pub mod types;
37
38// Re-export the main types and traits for convenience, and for backwards
39// compatibility.
40pub use {
41    check::{AccountCheckBuilder, Check},
42    compare::Compare,
43    config::{CheckContext, Config},
44    types::{InstructionResult, ProgramResult},
45};