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.

55 lines
1.2 KiB

  1. package state
  2. import (
  3. . "github.com/tendermint/go-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. )
  30. func (e ErrUnknownBlock) Error() string {
  31. return Fmt("Could not find block #%d", e.Height)
  32. }
  33. func (e ErrBlockHashMismatch) Error() string {
  34. return Fmt("App block hash (%X) does not match core block hash (%X) for height %d", e.AppHash, e.CoreHash, e.Height)
  35. }
  36. func (e ErrAppBlockHeightTooHigh) Error() string {
  37. return Fmt("App block height (%d) is higher than core (%d)", e.AppHeight, e.CoreHeight)
  38. }
  39. func (e ErrLastStateMismatch) Error() string {
  40. return Fmt("Latest tendermint block (%d) LastAppHash (%X) does not match app's AppHash (%X)", e.Height, e.Core, e.App)
  41. }
  42. func (e ErrStateMismatch) Error() string {
  43. return Fmt("State after replay does not match saved state. Got ----\n%v\nExpected ----\n%v\n", e.Got, e.Expected)
  44. }