Skip to main content

tengu_api/
error.rs

1//! Program errors.
2
3use steel::*;
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq, num_enum::IntoPrimitive)]
6#[repr(u32)]
7pub enum DojosError {
8    InsufficientPayment = 0,
9    DojoAlreadyInitialized = 1,
10    InvalidSlot = 2,
11    SlotOccupied = 3,
12    InsufficientChakra = 4,
13    InsufficientOre = 5,
14    InsufficientShards = 6,
15    BarracksUpgradeCooldown = 7,
16    ForgeUpgradeCooldown = 8,
17    InvalidMerge = 9,
18    InvalidMergeRarity = 10,
19    InvalidPrestigeUpgrade = 11,
20    InvalidLevelUp = 12,
21    EmissionCapReached = 13,
22    InsufficientTreasuryBalance = 14,
23    UnauthorizedKeeper = 15,
24    GenesisNotSet = 16,
25    GameNotLaunched = 17,
26    InvalidEntropyVar = 18,
27    UnauthorizedAdmin = 19,
28    TaskNotCompleted = 20,
29    TaskAlreadyClaimed = 21,
30    ShogunNotAssigned = 22,
31    NoReferralPending = 23,
32    FlashSaleDailyLimitReached = 24,
33    /// Unassign only allowed when replacing with another shogun via replace.
34    UnassignNotAllowed = 25,
35    /// Shogun already seated; use replace_shogun to swap.
36    ShogunAlreadySeated = 26,
37    /// Slot empty; use seat_shogun for empty slots.
38    SlotEmpty = 27,
39    /// Shogun account is full (MAX_SHOGUN_ACCOUNT_SIZE reached).
40    ShogunAccountFull = 28,
41    /// Treasury PDA must be owned by this program (re-initialize if redeployed).
42    TreasuryNotOwnedByProgram = 29,
43    /// Forge upgrade cooldown already ended; nothing to clear.
44    NoForgeCooldownToClear = 30,
45}
46
47error!(DojosError);