errors.gno
2.90 Kb · 49 lines
1package arena
2
3import "errors"
4
5// Errors are values created once, at package init: a panic with one of them
6// costs no allocation. Messages that need a value are built at the call.
7var (
8 errSpoofedRealm = errors.New("gnofly: spoofed realm")
9 errNotOwner = errors.New("gnofly: caller is not the owner")
10 errNotAdmin = errors.New("gnofly: caller is not an admin")
11 errNotReferee = errors.New("gnofly: caller is not a referee")
12
13 errInvalidSpec = errors.New("gnofly: invalid arena spec")
14 errInvalidMode = errors.New("gnofly: mode must be one of: battle-royale, deathmatch")
15 errInvalidStake = errors.New("gnofly: stake must be between 1000000 and 1000000000 ugnot")
16 errInvalidSeats = errors.New("gnofly: seats must satisfy 2 <= minSeats <= maxSeats <= 8")
17 errInvalidLives = errors.New("gnofly: lives must be between 1 and 3")
18 errInvalidSeconds = errors.New("gnofly: game time must be between 300 and 1800 seconds")
19 errInvalidKillTarget = errors.New("gnofly: the kill target must be between 0 and 20")
20 errRoyaleTarget = errors.New("gnofly: battle-royale has no kill target: the last one flying wins")
21 errInvalidAddress = errors.New("gnofly: invalid address")
22 errInvalidRefundDelay = errors.New("gnofly: refund delay must be between 60 and 86400 seconds")
23 errUnknownArena = errors.New("gnofly: unknown arena")
24
25 errNotUserCall = errors.New("gnofly: Enter must be called directly by a user (maketx call)")
26 errEntryClosed = errors.New("gnofly: this arena no longer takes entries")
27 errNotYetCreated = errors.New("gnofly: this arena was created in the future")
28 errInvalidTicket = errors.New("gnofly: ticket must be 64 lowercase hex characters")
29 errAlreadyInLobby = errors.New("gnofly: already in the lobby of this arena")
30 errLobbyFull = errors.New("gnofly: the lobby is full")
31 errNotInLobby = errors.New("gnofly: not in the lobby of this arena")
32 errNotExpired = errors.New("gnofly: this arena still takes entries")
33
34 errRoundRunning = errors.New("gnofly: the game of this arena has started")
35 errTooFewPlayers = errors.New("gnofly: fewer players than the arena requires")
36 errNoRound = errors.New("gnofly: the game of this arena is not running")
37 errRefundTooEarly = errors.New("gnofly: the game cannot be refunded yet")
38
39 errBadSettlement = errors.New("gnofly: settlement refused: the rule pays someone who did not play, twice, or nothing")
40 errNotConserved = errors.New("gnofly: settlement refused: payouts and fee do not add up to the pot")
41 errEscrow = errors.New("gnofly: escrow accounting error")
42 errInsolvent = errors.New("gnofly: the realm holds less than the stakes it owes")
43
44 errNothingToClaim = errors.New("gnofly: nothing to claim")
45 errCorruptClaims = errors.New("gnofly: corrupt claims record")
46
47 errCorruptResult = errors.New("gnofly: corrupt result record")
48 errCorruptEarnings = errors.New("gnofly: corrupt earnings record")
49)