This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patherrors.go
77 lines (60 loc) · 1.74 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package state
import "fmt"
type (
ErrInvalidBlock error
ErrProxyAppConn error
ErrUnknownBlock struct {
Height int64
}
ErrBlockHashMismatch struct {
CoreHash []byte
AppHash []byte
Height int64
}
ErrAppBlockHeightTooHigh struct {
CoreHeight int64
AppHeight int64
}
ErrLastStateMismatch struct {
Height int64
Core []byte
App []byte
}
ErrStateMismatch struct {
Got *State
Expected *State
}
ErrNoValSetForHeight struct {
Height int64
}
ErrNoConsensusParamsForHeight struct {
Height int64
}
ErrNoABCIResponsesForHeight struct {
Height int64
}
)
func (e ErrUnknownBlock) Error() string {
return fmt.Sprintf("Could not find block #%d", e.Height)
}
func (e ErrBlockHashMismatch) Error() string {
return fmt.Sprintf("App block hash (%X) does not match core block hash (%X) for height %d", e.AppHash, e.CoreHash, e.Height)
}
func (e ErrAppBlockHeightTooHigh) Error() string {
return fmt.Sprintf("App block height (%d) is higher than core (%d)", e.AppHeight, e.CoreHeight)
}
func (e ErrLastStateMismatch) Error() string {
return fmt.Sprintf("Latest tendermint block (%d) LastAppHash (%X) does not match app's AppHash (%X)", e.Height, e.Core, e.App)
}
func (e ErrStateMismatch) Error() string {
return fmt.Sprintf("State after replay does not match saved state. Got ----\n%v\nExpected ----\n%v\n", e.Got, e.Expected)
}
func (e ErrNoValSetForHeight) Error() string {
return fmt.Sprintf("Could not find validator set for height #%d", e.Height)
}
func (e ErrNoConsensusParamsForHeight) Error() string {
return fmt.Sprintf("Could not find consensus params for height #%d", e.Height)
}
func (e ErrNoABCIResponsesForHeight) Error() string {
return fmt.Sprintf("Could not find results for height #%d", e.Height)
}