use num_derive::FromPrimitive;
use thiserror::Error;
#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
pub enum SecurityTokenProgramError {
#[error("Verification program not found")]
VerificationProgramNotFound = 0x1,
#[error("Not enough accounts for verification")]
NotEnoughAccountsForVerification = 0x2,
#[error("Account intersection mismatch")]
AccountIntersectionMismatch = 0x3,
#[error("Invalid Verification Config PDA")]
InvalidVerificationConfigPda = 0x4,
#[error("Cannot modify external metadata account")]
CannotModifyExternalMetadataAccount = 0x5,
#[error("Internal metadata storage requires metadata to be provided")]
InternalMetadataRequiresData = 0x6,
#[error("External metadata storage cannot accept metadata data in this instruction")]
ExternalMetadataForbidsData = 0x7,
}
impl From<SecurityTokenProgramError> for solana_program_error::ProgramError {
fn from(e: SecurityTokenProgramError) -> Self {
solana_program_error::ProgramError::Custom(e as u32)
}
}