moonproof-runtime-ir 0.2.1

Rust consumer for compactc's contract.mpir — language-agnostic Compact contract IR. Loads, validates, and (eventually) interprets the IR to drive moonproof's contract runtime.
Documentation
use thiserror::Error;

#[derive(Debug, Error)]
pub enum IrError {
    #[error("I/O error reading IR: {0}")]
    Io(#[from] std::io::Error),

    #[error("CBOR parse error: {0}")]
    Cbor(String),

    #[error("unsupported schema-version {actual}; this consumer supports {supported}")]
    UnsupportedSchemaVersion { actual: u32, supported: u32 },

    #[error("invalid descriptor reference '{0}'")]
    InvalidDescriptor(String),

    #[error("hex decode error: {0}")]
    Hex(#[from] hex::FromHexError),
}

pub type Result<T> = std::result::Result<T, IrError>;