errors.gno
2.10 Kb · 33 lines
1package staker
2
3import (
4 ufmt "gno.land/p/nt/ufmt/v0"
5)
6
7const (
8 errDataNotFound = "[GNOSWAP-GOV_STAKER-001] requested data not found"
9 errInvalidAmount = "[GNOSWAP-GOV_STAKER-002] invalid amount"
10 errNoDelegatedAmount = "[GNOSWAP-GOV_STAKER-003] zero delegated amount"
11 errNotEnoughDelegated = "[GNOSWAP-GOV_STAKER-004] not enough delegated"
12 errInvalidAddress = "[GNOSWAP-GOV_STAKER-005] invalid address"
13 errNotEnoughBalance = "[GNOSWAP-GOV_STAKER-006] not enough balance"
14 errLessThanMinimum = "[GNOSWAP-GOV_STAKER-007] cannot delegate less than minimum amount"
15 errInvalidSnapshotTime = "[GNOSWAP-GOV_STAKER-008] invalid snapshot time"
16 errSameDelegatee = "[GNOSWAP-GOV_STAKER-009] cannot redelegate to same address"
17 errWithdrawNotCollectable = "[GNOSWAP-GOV_STAKER-010] withdraw is not collectable"
18 errAmountMustBeNonNegative = "[GNOSWAP-GOV_STAKER-011] amount must be non-negative"
19 errTotalStakedAmountOverflow = "[GNOSWAP-GOV_STAKER-012] total staked amount would overflow"
20 errRemoveAmountExceedsTotalStaked = "[GNOSWAP-GOV_STAKER-013] remove amount exceeds total staked amount"
21 errRemoveAmountExceedsStaked = "[GNOSWAP-GOV_STAKER-014] remove amount exceeds staked amount"
22 errAmountMustBePositive = "[GNOSWAP-GOV_STAKER-015] amount must be positive"
23 errRewardDebtUpdateRequired = "[GNOSWAP-GOV_STAKER-016] must update reward debt before claiming rewards"
24 errDelegatedAmountNegative = "[GNOSWAP-GOV_STAKER-017] delegated amount cannot be negative"
25 errUndelegationAmountNegative = "[GNOSWAP-GOV_STAKER-018] undelegation amount cannot be negative"
26 errDelegationNotFound = "[GNOSWAP-GOV_STAKER-019] delegation not found"
27 errInvalidAccrualEpoch = "[GNOSWAP-GOV_STAKER-020] accrual epoch is older than the epoch in force"
28 errInvalidAccrualBuckets = "[GNOSWAP-GOV_STAKER-021] invalid accrual buckets"
29)
30
31func makeErrorWithDetails(message string, detail string) error {
32 return ufmt.Errorf("%s || %s", message, detail)
33}