-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
91 lines (73 loc) · 3.75 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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// nolint
package types
import (
sdk "github.com/evoblockchain/evochain/libs/cosmos-sdk/types"
sdkerrors "github.com/evoblockchain/evochain/libs/cosmos-sdk/types/errors"
)
const (
DefaultCodespace string = ModuleName
CodeNilDelegatorAddr uint32 = 67800
CodeNoValidatorCommission uint32 = 67801
CodeSetWithdrawAddrDisabled uint32 = 67802
CodeInvalidRoute uint32 = 67803
CodeWithdrawValidatorRewardsAndCommissionFailed uint32 = 67804
CodeAccAddressFromBech32Failed uint32 = 67805
CodeValAddressFromBech32 uint32 = 67806
CodeSendCoinsFromModuleToAccountFailed uint32 = 67807
CodeWithdrawValidatorCommissionFailed uint32 = 67808
CodeUnknownDistributionMsgType uint32 = 67809
CodeUnknownDistributionCommunityPoolProposaType uint32 = 67810
CodeUnknownDistributionQueryType uint32 = 67811
CodeUnknownDistributionParamType uint32 = 67812
CodeWithdrawAddrInBlacklist uint32 = 67813
CodeNilWithdrawAddr uint32 = 67814
CodeNilValidatorAddr uint32 = 67815
CodeBadDistribution uint32 = 67816
CodeInvalidProposalAmount uint32 = 67817
CodeEmptyProposalRecipient uint32 = 67818
)
func ErrNilDelegatorAddr() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeNilDelegatorAddr, "delegator address is empty")
}
func ErrNoValidatorCommission() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeNoValidatorCommission, "no validator commission to withdraw")
}
func ErrSetWithdrawAddrDisabled() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeSetWithdrawAddrDisabled, "set withdraw address disabled")
}
func ErrSendCoinsFromModuleToAccountFailed() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeSendCoinsFromModuleToAccountFailed, "send coins from module to account failed")
}
func ErrWithdrawValidatorCommissionFailed() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeWithdrawValidatorCommissionFailed, "withdraw validator commission failed")
}
func ErrUnknownDistributionMsgType() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeUnknownDistributionMsgType, "unknown distribution message type")
}
func ErrUnknownDistributionCommunityPoolProposaType() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeUnknownDistributionCommunityPoolProposaType, "unknown community pool proposal type")
}
func ErrUnknownDistributionQueryType() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeUnknownDistributionQueryType, "unknown distribution query type")
}
func ErrUnknownDistributionParamType() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeUnknownDistributionParamType, "unknown distribution param type")
}
func ErrWithdrawAddrInblacklist() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeWithdrawAddrInBlacklist, "withdraw address in black list")
}
func ErrNilWithdrawAddr() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeNilWithdrawAddr, "withdraw address is empty")
}
func ErrNilValidatorAddr() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeNilValidatorAddr, "validator address is empty")
}
func ErrBadDistribution() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeBadDistribution, "community pool does not have sufficient coins to distribute")
}
func ErrInvalidProposalAmount() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeInvalidProposalAmount, "invalid community pool spend proposal amount")
}
func ErrEmptyProposalRecipient() sdk.Error {
return sdkerrors.New(DefaultCodespace, CodeEmptyProposalRecipient, "invalid community pool spend proposal recipient")
}