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 deposit
41    #[error("Nothing to deposit")]
42    NothingToDeposit = 0x1779,
43    /// 6010 - Nothing to withdraw
44    #[error("Nothing to withdraw")]
45    NothingToWithdraw = 0x177A,
46    /// 6011 - Nothing staked
47    #[error("Nothing staked")]
48    NothingStaked = 0x177B,
49    /// 6012 - Stacked token are locked
50    #[error("Stacked token are locked")]
51    StakedTokensLocked = 0x177C,
52    /// 6013 - Staking is disabled
53    #[error("Staking is disabled")]
54    StakingDisabled = 0x177D,
55    /// 6014 - Unstaking is disabled
56    #[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