defituna_staking/generated/errors/
tuna_staking.rs1use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum TunaStakingError {
13 #[error("Invalid instruction arguments")]
15 InvalidInstructionArguments = 0x1770,
16 #[error("Insufficient remaining accounts")]
18 RemainingAccountsInsufficient = 0x1771,
19 #[error("Math overflow")]
21 MathOverflow = 0x1772,
22 #[error("Math underflow")]
24 MathUnderflow = 0x1773,
25 #[error("Type cast overflow")]
27 TypeCastOverflow = 0x1774,
28 #[error("Transfer fee calculation failed")]
30 TransferFeeCalculationError = 0x1775,
31 #[error("Token mint has unsupported attributes")]
33 UnsupportedTokenMint = 0x1776,
34 #[error("Withdraw request exceeds user balance")]
36 WithdrawRequestExceedsUserBalance = 0x1777,
37 #[error("Tokens can't be unstaked because the cooldown has not expired")]
39 CooldownNotExpired = 0x1778,
40 #[error("Nothing to stake")]
42 NothingToStake = 0x1779,
43 #[error("Nothing to compound")]
45 NothingToCompound = 0x177A,
46 #[error("Nothing to deposit")]
48 NothingToDeposit = 0x177B,
49 #[error("Nothing to withdraw")]
51 NothingToWithdraw = 0x177C,
52 #[error("Nothing to swap")]
54 NothingToSwap = 0x177D,
55 #[error("Nothing staked")]
57 NothingStaked = 0x177E,
58 #[error("Staked token are locked")]
60 StakedTokensLocked = 0x177F,
61 #[error("Staking is disabled")]
63 StakingDisabled = 0x1780,
64 #[error("Unstaking is disabled")]
66 UnstakingDisabled = 0x1781,
67 #[error("Withdraw is disabled")]
69 WithdrawDisabled = 0x1782,
70}
71
72impl solana_program_error::PrintProgramError for TunaStakingError {
73 fn print<E>(&self) {
74 solana_msg::msg!(&self.to_string());
75 }
76}
77
78impl<T> solana_decode_error::DecodeError<T> for TunaStakingError {
79 fn type_of() -> &'static str {
80 "TunaStakingError"
81 }
82}
83