You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.7 KiB

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