mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-10 05:50:19 +00:00
42 lines
1.0 KiB
Go
42 lines
1.0 KiB
Go
package block
|
|
|
|
import "fmt"
|
|
|
|
type (
|
|
// ErrInvalidCommitHeight is returned when we encounter a commit with an
|
|
// unexpected height.
|
|
ErrInvalidCommitHeight struct {
|
|
Expected int64
|
|
Actual int64
|
|
}
|
|
|
|
// ErrInvalidCommitSignatures is returned when we encounter a commit where
|
|
// the number of signatures doesn't match the number of validators.
|
|
ErrInvalidCommitSignatures struct {
|
|
Expected int
|
|
Actual int
|
|
}
|
|
)
|
|
|
|
func NewErrInvalidCommitHeight(expected, actual int64) ErrInvalidCommitHeight {
|
|
return ErrInvalidCommitHeight{
|
|
Expected: expected,
|
|
Actual: actual,
|
|
}
|
|
}
|
|
|
|
func (e ErrInvalidCommitHeight) Error() string {
|
|
return fmt.Sprintf("Invalid commit -- wrong height: %v vs %v", e.Expected, e.Actual)
|
|
}
|
|
|
|
func NewErrInvalidCommitSignatures(expected, actual int) ErrInvalidCommitSignatures {
|
|
return ErrInvalidCommitSignatures{
|
|
Expected: expected,
|
|
Actual: actual,
|
|
}
|
|
}
|
|
|
|
func (e ErrInvalidCommitSignatures) Error() string {
|
|
return fmt.Sprintf("Invalid commit -- wrong set size: %v vs %v", e.Expected, e.Actual)
|
|
}
|