forked from StellarCheckMate/Checkmate-Escrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.rs
More file actions
77 lines (76 loc) · 2.74 KB
/
Copy patherrors.rs
File metadata and controls
77 lines (76 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
use soroban_sdk::contracterror;
/// Escrow contract error codes and variants.
///
/// Every error is represented as a small integer (`u32`) discriminant. When a contract call fails,
/// the CLI/SDK returns something like `Error(Contract, #4)`.
///
/// **For the complete error reference with causes, recovery actions, and examples,**
/// **see [`docs/error-codes.md`](../../../docs/error-codes.md).**
///
/// This document is kept in lockstep with this enum — if you add or remove a variant,
/// update `docs/error-codes.md` in the same PR.
///
/// This enum currently has 49 variants, which is the hard ceiling `#[contracterror]`
/// supports in this soroban-sdk version -- adding a 50th panics the proc macro at
/// compile time with `LengthExceedsMax` (confirmed empirically; not documented by the
/// SDK). Adding a new error requires either freeing a slot by repurposing an existing,
/// semantically-close variant, or removing one that's been superseded.
#[contracterror]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum Error {
MatchNotFound = 1,
AlreadyFunded = 2,
NotFunded = 3,
Unauthorized = 4,
InvalidState = 5,
AlreadyExists = 6,
AlreadyInitialized = 7,
Overflow = 8,
ContractPaused = 9,
InvalidAmount = 10,
DuplicateGameId = 13,
MatchNotExpired = 14,
InvalidGameId = 15,
InvalidPlayers = 16,
TokenNotAllowed = 17,
InvalidAddress = 18,
MatchAlreadyActive = 19,
InvalidTimeout = 20,
SnapshotNotFound = 21,
VestingNotExpired = 22,
AlreadyClaimed = 23,
DisputeNotFound = 24,
PendingResultNotFound = 25,
DisputeAlreadyResolved = 26,
VotingPeriodElapsed = 27,
AlreadyVoted = 28,
NotStaker = 29,
VotingPeriodNotElapsed = 30,
MatchNotInPendingResult = 31,
DisputePeriodNotElapsed = 32,
DisputeAlreadyRaised = 33,
InvalidEvidenceHash = 34,
TierStakeNotAllowed = 35,
NotInitialized = 36,
InvalidPauseState = 37,
ConversionRateOutOfBounds = 39,
ConversionRateStalePriceSource = 40,
InsufficientBond = 41,
QuorumNotMet = 42,
InsufficientHoldingDuration = 43,
TooManyActiveMatches = 45,
/// Token is not issued by a registered stablecoin issuer and stablecoin-only mode is enabled.
NotStablecoin = 46,
UpgradeNotScheduled = 47,
UpgradeReviewPeriodNotElapsed = 48,
InvalidVersion = 49,
UpgradeAlreadyScheduled = 50,
/// Oracle has already submitted a confirmation for this match.
OracleAlreadyConfirmed = 51,
/// Oracle submitted a result that conflicts with a previously recorded majority result.
ConflictingResult = 52,
/// The caller is not a registered oracle.
NotAnOracle = 54,
/// A deposit for this match is already in progress (reentrancy guard).
DepositInProgress = 55,
}