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.

29 lines
908 B

  1. package provider
  2. import (
  3. "errors"
  4. "fmt"
  5. )
  6. var (
  7. // ErrHeightTooHigh is returned when the height is higher than the last
  8. // block that the provider has. The light client will not remove the provider
  9. ErrHeightTooHigh = errors.New("height requested is too high")
  10. // ErrLightBlockNotFound is returned when a provider can't find the
  11. // requested header (i.e. it has been pruned).
  12. // The light client will not remove the provider
  13. ErrLightBlockNotFound = errors.New("light block not found")
  14. // ErrNoResponse is returned if the provider doesn't respond to the
  15. // request in a gieven time
  16. ErrNoResponse = errors.New("client failed to respond")
  17. )
  18. // ErrBadLightBlock is returned when a provider returns an invalid
  19. // light block.
  20. type ErrBadLightBlock struct {
  21. Reason error
  22. }
  23. func (e ErrBadLightBlock) Error() string {
  24. return fmt.Sprintf("client provided bad signed header: %s", e.Reason.Error())
  25. }