github.com/evdatsion/aphelion-dpos-bft@v0.32.1/state/errors.go (about) 1 package state 2 3 import "fmt" 4 5 type ( 6 ErrInvalidBlock error 7 ErrProxyAppConn error 8 9 ErrUnknownBlock struct { 10 Height int64 11 } 12 13 ErrBlockHashMismatch struct { 14 CoreHash []byte 15 AppHash []byte 16 Height int64 17 } 18 19 ErrAppBlockHeightTooHigh struct { 20 CoreHeight int64 21 AppHeight int64 22 } 23 24 ErrLastStateMismatch struct { 25 Height int64 26 Core []byte 27 App []byte 28 } 29 30 ErrStateMismatch struct { 31 Got *State 32 Expected *State 33 } 34 35 ErrNoValSetForHeight struct { 36 Height int64 37 } 38 39 ErrNoConsensusParamsForHeight struct { 40 Height int64 41 } 42 43 ErrNoABCIResponsesForHeight struct { 44 Height int64 45 } 46 ) 47 48 func (e ErrUnknownBlock) Error() string { 49 return fmt.Sprintf("Could not find block #%d", e.Height) 50 } 51 52 func (e ErrBlockHashMismatch) Error() string { 53 return fmt.Sprintf("App block hash (%X) does not match core block hash (%X) for height %d", e.AppHash, e.CoreHash, e.Height) 54 } 55 56 func (e ErrAppBlockHeightTooHigh) Error() string { 57 return fmt.Sprintf("App block height (%d) is higher than core (%d)", e.AppHeight, e.CoreHeight) 58 } 59 func (e ErrLastStateMismatch) Error() string { 60 return fmt.Sprintf("Latest tendermint block (%d) LastAppHash (%X) does not match app's AppHash (%X)", e.Height, e.Core, e.App) 61 } 62 63 func (e ErrStateMismatch) Error() string { 64 return fmt.Sprintf("State after replay does not match saved state. Got ----\n%v\nExpected ----\n%v\n", e.Got, e.Expected) 65 } 66 67 func (e ErrNoValSetForHeight) Error() string { 68 return fmt.Sprintf("Could not find validator set for height #%d", e.Height) 69 } 70 71 func (e ErrNoConsensusParamsForHeight) Error() string { 72 return fmt.Sprintf("Could not find consensus params for height #%d", e.Height) 73 } 74 75 func (e ErrNoABCIResponsesForHeight) Error() string { 76 return fmt.Sprintf("Could not find results for height #%d", e.Height) 77 }