32 lines
1.0 KiB
Go
32 lines
1.0 KiB
Go
//nolint
|
|
package slashing
|
|
|
|
import (
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
)
|
|
|
|
// Local code type
|
|
type CodeType = sdk.CodeType
|
|
|
|
const (
|
|
// Default slashing codespace
|
|
DefaultCodespace sdk.CodespaceType = 10
|
|
|
|
CodeInvalidValidator CodeType = 101
|
|
CodeValidatorJailed CodeType = 102
|
|
CodeValidatorNotRevoked CodeType = 103
|
|
)
|
|
|
|
func ErrNoValidatorForAddress(codespace sdk.CodespaceType) sdk.Error {
|
|
return sdk.NewError(codespace, CodeInvalidValidator, "that address is not associated with any known validator")
|
|
}
|
|
func ErrBadValidatorAddr(codespace sdk.CodespaceType) sdk.Error {
|
|
return sdk.NewError(codespace, CodeInvalidValidator, "validator does not exist for that address")
|
|
}
|
|
func ErrValidatorJailed(codespace sdk.CodespaceType) sdk.Error {
|
|
return sdk.NewError(codespace, CodeValidatorJailed, "validator jailed, cannot yet be unrevoked")
|
|
}
|
|
func ErrValidatorNotRevoked(codespace sdk.CodespaceType) sdk.Error {
|
|
return sdk.NewError(codespace, CodeValidatorNotRevoked, "validator not revoked, cannot be unrevoked")
|
|
}
|