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.

31 lines
676 B

  1. package mock
  2. import (
  3. "errors"
  4. "github.com/tendermint/tendermint/light/provider"
  5. "github.com/tendermint/tendermint/types"
  6. )
  7. var errNoResp = errors.New("no response from provider")
  8. type deadMock struct {
  9. chainID string
  10. }
  11. // NewDeadMock creates a mock provider that always errors.
  12. func NewDeadMock(chainID string) provider.Provider {
  13. return &deadMock{chainID: chainID}
  14. }
  15. func (p *deadMock) ChainID() string { return p.chainID }
  16. func (p *deadMock) String() string { return "deadMock" }
  17. func (p *deadMock) LightBlock(height int64) (*types.LightBlock, error) {
  18. return nil, errNoResp
  19. }
  20. func (p *deadMock) ReportEvidence(ev types.Evidence) error {
  21. return errNoResp
  22. }