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.

63 lines
1.4 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 int
  10. }
  11. ErrBlockHashMismatch struct {
  12. CoreHash []byte
  13. AppHash []byte
  14. Height int
  15. }
  16. ErrAppBlockHeightTooHigh struct {
  17. CoreHeight int
  18. AppHeight int
  19. }
  20. ErrLastStateMismatch struct {
  21. Height int
  22. Core []byte
  23. App []byte
  24. }
  25. ErrStateMismatch struct {
  26. Got *State
  27. Expected *State
  28. }
  29. ErrNoValSetForHeight struct {
  30. Height int
  31. }
  32. )
  33. func (e ErrUnknownBlock) Error() string {
  34. return cmn.Fmt("Could not find block #%d", e.Height)
  35. }
  36. func (e ErrBlockHashMismatch) Error() string {
  37. return cmn.Fmt("App block hash (%X) does not match core block hash (%X) for height %d", e.AppHash, e.CoreHash, e.Height)
  38. }
  39. func (e ErrAppBlockHeightTooHigh) Error() string {
  40. return cmn.Fmt("App block height (%d) is higher than core (%d)", e.AppHeight, e.CoreHeight)
  41. }
  42. func (e ErrLastStateMismatch) Error() string {
  43. return cmn.Fmt("Latest tendermint block (%d) LastAppHash (%X) does not match app's AppHash (%X)", e.Height, e.Core, e.App)
  44. }
  45. func (e ErrStateMismatch) Error() string {
  46. return cmn.Fmt("State after replay does not match saved state. Got ----\n%v\nExpected ----\n%v\n", e.Got, e.Expected)
  47. }
  48. func (e ErrNoValSetForHeight) Error() string {
  49. return cmn.Fmt("Could not find validator set for height #%d", e.Height)
  50. }