lighthouse-sol 0.1.11

lighthouse client
Documentation
//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/codama-idl/codama>
//!

use num_derive::FromPrimitive;
use thiserror::Error;

#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum LighthouseError {
    /// 6000 - Invalid instruction
    #[error("Invalid instruction")]
    InvalidInstructionData = 0x1770,
    /// 6001 - AssertionFailed
    #[error("AssertionFailed")]
    AssertionFailed = 0x1771,
    /// 6002 - NotEnoughAccounts
    #[error("NotEnoughAccounts")]
    NotEnoughAccounts = 0x1772,
    /// 6003 - BumpNotFound
    #[error("BumpNotFound")]
    BumpNotFound = 0x1773,
    /// 6004 - AccountBorrowFailed
    #[error("AccountBorrowFailed")]
    AccountBorrowFailed = 0x1774,
    /// 6005 - RangeOutOfBounds
    #[error("RangeOutOfBounds")]
    RangeOutOfBounds = 0x1775,
    /// 6006 - IndexOutOfBounds
    #[error("IndexOutOfBounds")]
    IndexOutOfBounds = 0x1776,
    /// 6007 - FailedToDeserialize
    #[error("FailedToDeserialize")]
    FailedToDeserialize = 0x1777,
    /// 6008 - FailedToSerialize
    #[error("FailedToSerialize")]
    FailedToSerialize = 0x1778,
    /// 6009 - AccountOwnerMismatch
    #[error("AccountOwnerMismatch")]
    AccountOwnerMismatch = 0x1779,
    /// 6010 - AccountKeyMismatch
    #[error("AccountKeyMismatch")]
    AccountKeyMismatch = 0x177A,
    /// 6011 - AccountNotInitialized
    #[error("AccountNotInitialized")]
    AccountNotInitialized = 0x177B,
    /// 6012 - AccountOwnerValidationFailed
    #[error("AccountOwnerValidationFailed")]
    AccountOwnerValidationFailed = 0x177C,
    /// 6013 - AccountFundedValidationFailed
    #[error("AccountFundedValidationFailed")]
    AccountFundedValidationFailed = 0x177D,
    /// 6014 - AccountDiscriminatorValidationFailed
    #[error("AccountDiscriminatorValidationFailed")]
    AccountDiscriminatorValidationFailed = 0x177E,
    /// 6015 - AccountValidaitonFailed
    #[error("AccountValidaitonFailed")]
    AccountValidationFailed = 0x177F,
    /// 6016 - CrossProgramInvokeViolation
    #[error("CrossProgramInvokeViolation")]
    CrossProgramInvokeViolation = 0x1780,
}

impl solana_program_error::PrintProgramError for LighthouseError {
    fn print<E>(&self) {
        solana_msg::msg!(&self.to_string());
    }
}

impl<T> solana_decode_error::DecodeError<T> for LighthouseError {
    fn type_of() -> &'static str {
        "LighthouseError"
    }
}