-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
errors.go
39 lines (31 loc) · 940 Bytes
/
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
//nolint
package fee
import (
"fmt"
abci "github.com/tendermint/abci/types"
"github.com/cosmos/cosmos-sdk/errors"
)
var (
errInsufficientFees = fmt.Errorf("Insufficient fees")
errWrongFeeDenom = fmt.Errorf("Required fee denomination")
errSkipFees = fmt.Errorf("Skip fees")
invalidInput = abci.CodeType_BaseInvalidInput
)
func ErrInsufficientFees() errors.TMError {
return errors.WithCode(errInsufficientFees, invalidInput)
}
func IsInsufficientFeesErr(err error) bool {
return errors.IsSameError(errInsufficientFees, err)
}
func ErrWrongFeeDenom(denom string) errors.TMError {
return errors.WithMessage(denom, errWrongFeeDenom, invalidInput)
}
func IsWrongFeeDenomErr(err error) bool {
return errors.IsSameError(errWrongFeeDenom, err)
}
func ErrSkipFees() errors.TMError {
return errors.WithCode(errSkipFees, invalidInput)
}
func IsSkipFeesErr(err error) bool {
return errors.IsSameError(errSkipFees, err)
}