use num_derive::FromPrimitive;
use thiserror::Error;
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum LighthouseError {
#[error("Invalid instruction")]
InvalidInstructionData = 0x1770,
#[error("AssertionFailed")]
AssertionFailed = 0x1771,
#[error("NotEnoughAccounts")]
NotEnoughAccounts = 0x1772,
#[error("BumpNotFound")]
BumpNotFound = 0x1773,
#[error("AccountBorrowFailed")]
AccountBorrowFailed = 0x1774,
#[error("RangeOutOfBounds")]
RangeOutOfBounds = 0x1775,
#[error("IndexOutOfBounds")]
IndexOutOfBounds = 0x1776,
#[error("FailedToDeserialize")]
FailedToDeserialize = 0x1777,
#[error("FailedToSerialize")]
FailedToSerialize = 0x1778,
#[error("AccountOwnerMismatch")]
AccountOwnerMismatch = 0x1779,
#[error("AccountKeyMismatch")]
AccountKeyMismatch = 0x177A,
#[error("AccountNotInitialized")]
AccountNotInitialized = 0x177B,
#[error("AccountOwnerValidationFailed")]
AccountOwnerValidationFailed = 0x177C,
#[error("AccountFundedValidationFailed")]
AccountFundedValidationFailed = 0x177D,
#[error("AccountDiscriminatorValidationFailed")]
AccountDiscriminatorValidationFailed = 0x177E,
#[error("AccountValidaitonFailed")]
AccountValidationFailed = 0x177F,
#[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"
}
}