Some checks are pending
docker-build-cometbft / vars (push) Waiting to run
docker-build-cometbft / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-cometbft / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-cometbft / merge-images (push) Blocked by required conditions
docker-build-e2e-node / vars (push) Waiting to run
docker-build-e2e-node / build-images (amd64, ubuntu-24.04) (push) Blocked by required conditions
docker-build-e2e-node / build-images (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
docker-build-e2e-node / merge-images (push) Blocked by required conditions
53 lines
1.1 KiB
Go
53 lines
1.1 KiB
Go
package blocksync
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
|
|
"github.com/cosmos/gogoproto/proto"
|
|
)
|
|
|
|
var (
|
|
// ErrNilMessage is returned when provided message is empty
|
|
ErrNilMessage = errors.New("message cannot be nil")
|
|
)
|
|
|
|
// ErrInvalidBase is returned when peer informs of a status with invalid height
|
|
type ErrInvalidHeight struct {
|
|
Height int64
|
|
Reason string
|
|
}
|
|
|
|
func (e ErrInvalidHeight) Error() string {
|
|
return fmt.Sprintf("invalid height %v: %s", e.Height, e.Reason)
|
|
}
|
|
|
|
// ErrInvalidBase is returned when peer informs of a status with invalid base
|
|
type ErrInvalidBase struct {
|
|
Base int64
|
|
Reason string
|
|
}
|
|
|
|
func (e ErrInvalidBase) Error() string {
|
|
return fmt.Sprintf("invalid base %v: %s", e.Base, e.Reason)
|
|
}
|
|
|
|
type ErrUnknownMessageType struct {
|
|
Msg proto.Message
|
|
}
|
|
|
|
func (e ErrUnknownMessageType) Error() string {
|
|
return fmt.Sprintf("unknown message type %T", e.Msg)
|
|
}
|
|
|
|
type ErrReactorValidation struct {
|
|
Err error
|
|
}
|
|
|
|
func (e ErrReactorValidation) Error() string {
|
|
return fmt.Sprintf("reactor validation error: %v", e.Err)
|
|
}
|
|
|
|
func (e ErrReactorValidation) Unwrap() error {
|
|
return e.Err
|
|
}
|