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.

71 lines
1.6 KiB

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