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 deposit")]
42 NothingToDeposit = 0x1779,
43 #[error("Nothing to withdraw")]
45 NothingToWithdraw = 0x177A,
46 #[error("Nothing staked")]
48 NothingStaked = 0x177B,
49 #[error("Stacked token are locked")]
51 StakedTokensLocked = 0x177C,
52 #[error("Staking is disabled")]
54 StakingDisabled = 0x177D,
55 #[error("Unstaking is disabled")]
57 UnstakingDisabled = 0x177E,
58}
59
60impl solana_program_error::PrintProgramError for TunaStakingError {
61 fn print<E>(&self) {
62 solana_msg::msg!(&self.to_string());
63 }
64}
65
66impl<T> solana_decode_error::DecodeError<T> for TunaStakingError {
67 fn type_of() -> &'static str {
68 "TunaStakingError"
69 }
70}
71