-
Notifications
You must be signed in to change notification settings - Fork 556
/
errors.go
45 lines (34 loc) · 1.05 KB
/
errors.go
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
package types
import (
"errors"
fmt "fmt"
"cosmossdk.io/math"
)
var (
ErrNoDelegation = errors.New("No existing delegation")
)
type UndelegateMoreThanDelegatedError struct {
TotalDelegatedAmt math.LegacyDec
UndelegationAmt math.Int
}
func (e UndelegateMoreThanDelegatedError) Error() string {
return fmt.Sprintf("total tokenAmountToUndelegate more than delegated amount have %s got %s\n", e.TotalDelegatedAmt, e.UndelegationAmt)
}
type NoValidatorSetOrExistingDelegationsError struct {
DelegatorAddr string
}
func (e NoValidatorSetOrExistingDelegationsError) Error() string {
return fmt.Sprintf("user %s doesn't have validator set or existing delegations", e.DelegatorAddr)
}
type ValsetRatioGreaterThanOneError struct {
ValsetRatio math.LegacyDec
}
func (e ValsetRatioGreaterThanOneError) Error() string {
return fmt.Sprintf("valset ratio %s greater than one", e.ValsetRatio)
}
type ValidatorNotFoundError struct {
ValidatorAddr string
}
func (e ValidatorNotFoundError) Error() string {
return fmt.Sprintf("validator %s not found", e.ValidatorAddr)
}