use num_derive::FromPrimitive;
use thiserror::Error;
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum LighthouseError {
#[error("Invalid instruction")]
InvalidInstructionData,
#[error("AssertionFailed")]
AssertionFailed,
#[error("NotEnoughAccounts")]
NotEnoughAccounts,
#[error("BumpNotFound")]
BumpNotFound,
#[error("AccountBorrowFailed")]
AccountBorrowFailed,
#[error("RangeOutOfBounds")]
RangeOutOfBounds,
#[error("IndexOutOfBounds")]
IndexOutOfBounds,
#[error("FailedToDeserialize")]
FailedToDeserialize,
#[error("FailedToSerialize")]
FailedToSerialize,
#[error("AccountOwnerMismatch")]
AccountOwnerMismatch,
#[error("AccountKeyMismatch")]
AccountKeyMismatch,
#[error("AccountNotInitialized")]
AccountNotInitialized,
#[error("AccountOwnerValidationFailed")]
AccountOwnerValidationFailed,
#[error("AccountFundedValidationFailed")]
AccountFundedValidationFailed,
#[error("AccountDiscriminatorValidationFailed")]
AccountDiscriminatorValidationFailed,
#[error("AccountValidaitonFailed")]
AccountValidationFailed,
#[error("CrossProgramInvokeViolation")]
CrossProgramInvokeViolation,
}
impl solana_program::program_error::PrintProgramError for LighthouseError {
fn print<E>(&self) {
solana_program::msg!(&self.to_string());
}
}