defituna_staking/generated/errors/
tuna_staking.rs

1//! This code was AUTOGENERATED using the codama library.
2//! Please DO NOT EDIT THIS FILE, instead use visitors
3//! to add features, then rerun codama to update it.
4//!
5//! <https://github.com/codama-idl/codama>
6//!
7
8use num_derive::FromPrimitive;
9use thiserror::Error;
10
11#[derive(Clone, Debug, Eq, Error, FromPrimitive, PartialEq)]
12pub enum TunaStakingError {
13    /// 6000 - Invalid instruction arguments
14    #[error("Invalid instruction arguments")]
15    InvalidInstructionArguments = 0x1770,
16    /// 6001 - Insufficient remaining accounts
17    #[error("Insufficient remaining accounts")]
18    RemainingAccountsInsufficient = 0x1771,
19    /// 6002 - Math overflow
20    #[error("Math overflow")]
21    MathOverflow = 0x1772,
22    /// 6003 - Math underflow
23    #[error("Math underflow")]
24    MathUnderflow = 0x1773,
25    /// 6004 - Type cast overflow
26    #[error("Type cast overflow")]
27    TypeCastOverflow = 0x1774,
28    /// 6005 - Transfer fee calculation failed
29    #[error("Transfer fee calculation failed")]
30    TransferFeeCalculationError = 0x1775,
31    /// 6006 - Token mint has unsupported attributes
32    #[error("Token mint has unsupported attributes")]
33    UnsupportedTokenMint = 0x1776,
34    /// 6007 - Withdraw request exceeds user balance
35    #[error("Withdraw request exceeds user balance")]
36    WithdrawRequestExceedsUserBalance = 0x1777,
37    /// 6008 - Tokens can't be unstaked because the cooldown has not expired
38    #[error("Tokens can't be unstaked because the cooldown has not expired")]
39    CooldownNotExpired = 0x1778,
40    /// 6009 - Nothing to stake
41    #[error("Nothing to stake")]
42    NothingToStake = 0x1779,
43    /// 6010 - Nothing to compound
44    #[error("Nothing to compound")]
45    NothingToCompound = 0x177A,
46    /// 6011 - Nothing to deposit
47    #[error("Nothing to deposit")]
48    NothingToDeposit = 0x177B,
49    /// 6012 - Nothing to withdraw
50    #[error("Nothing to withdraw")]
51    NothingToWithdraw = 0x177C,
52    /// 6013 - Nothing to swap
53    #[error("Nothing to swap")]
54    NothingToSwap = 0x177D,
55    /// 6014 - Nothing staked
56    #[error("Nothing staked")]
57    NothingStaked = 0x177E,
58    /// 6015 - Staked token are locked
59    #[error("Staked token are locked")]
60    StakedTokensLocked = 0x177F,
61    /// 6016 - Staking is disabled
62    #[error("Staking is disabled")]
63    StakingDisabled = 0x1780,
64    /// 6017 - Unstaking is disabled
65    #[error("Unstaking is disabled")]
66    UnstakingDisabled = 0x1781,
67    /// 6018 - Withdraw is disabled
68    #[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