1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! This code was AUTOGENERATED using the kinobi library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun kinobi to update it.
//!
//! [https://github.com/metaplex-foundation/kinobi]
//!

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

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

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