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. }