forked from terra-money/classic-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
errors.go
32 lines (25 loc) · 992 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
package oracle
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// Oracle errors reserve 1101-1199
const (
DefaultCodespace sdk.CodespaceType = "oracle"
CodeNotValidator sdk.CodeType = 1
CodeUnknownDenom sdk.CodeType = 2
CodeInvalidPrice sdk.CodeType = 3
)
// ----------------------------------------
// Error constructors
// ErrUnknownDenomination called when the signer of a Msg is not a validator
func ErrUnknownDenomination(codespace sdk.CodespaceType, denom string) sdk.Error {
return sdk.NewError(codespace, CodeUnknownDenom, denom)
}
// ErrNotValidator called when the signer of a Msg is not a validator
func ErrNotValidator(codespace sdk.CodespaceType, address sdk.AccAddress) sdk.Error {
return sdk.NewError(codespace, CodeNotValidator, address.String())
}
// ErrInvalidPrice called when the price submitted is not valid
func ErrInvalidPrice(codespace sdk.CodespaceType, price sdk.Dec) sdk.Error {
return sdk.NewError(codespace, CodeInvalidPrice, price.String())
}