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    /// Merge not yet implemented for compression (TODO).
46    MergeNotImplemented = 31,
47    /// Mission: invalid mission type.
48    InvalidMissionType = 32,
49    /// Mission: invalid slot mask (popcount, bits, or empty slot).
50    InvalidSlotMask = 33,
51    /// Mission: slot mask overlaps with another active mission.
52    SlotOverlap = 34,
53    /// Mission: not yet complete (duration not elapsed).
54    MissionNotComplete = 35,
55    /// Mission: no empty mission entry (all 12 in use).
56    NoEmptyMissionEntry = 36,
57    /// Slot is on an active mission; replace/level_up/prestige blocked (SP exploit).
58    SlotOnMission = 37,
59}
60
61error!(DojosError);