2018-03-28 21:40:06 -07:00
|
|
|
package simplestake
|
2018-03-18 14:37:10 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2018-03-28 21:40:06 -07:00
|
|
|
// simplestake errors reserve 300 - 399.
|
2018-03-21 15:21:46 -07:00
|
|
|
CodeEmptyValidator sdk.CodeType = 300
|
|
|
|
CodeInvalidUnbond sdk.CodeType = 301
|
|
|
|
CodeEmptyStake sdk.CodeType = 302
|
|
|
|
CodeIncorrectStakingToken sdk.CodeType = 303
|
2018-03-18 14:37:10 -07:00
|
|
|
)
|
|
|
|
|
2018-03-21 15:21:46 -07:00
|
|
|
func ErrIncorrectStakingToken() sdk.Error {
|
|
|
|
return newError(CodeIncorrectStakingToken, "")
|
|
|
|
}
|
|
|
|
|
2018-03-18 14:37:10 -07:00
|
|
|
func ErrEmptyValidator() sdk.Error {
|
|
|
|
return newError(CodeEmptyValidator, "")
|
|
|
|
}
|
|
|
|
|
|
|
|
func ErrInvalidUnbond() sdk.Error {
|
|
|
|
return newError(CodeInvalidUnbond, "")
|
|
|
|
}
|
|
|
|
|
2018-03-20 08:04:08 -07:00
|
|
|
func ErrEmptyStake() sdk.Error {
|
|
|
|
return newError(CodeEmptyStake, "")
|
|
|
|
}
|
|
|
|
|
2018-03-18 14:37:10 -07:00
|
|
|
// -----------------------------
|
|
|
|
// Helpers
|
|
|
|
|
|
|
|
func newError(code sdk.CodeType, msg string) sdk.Error {
|
|
|
|
return sdk.NewError(code, msg)
|
|
|
|
}
|