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
684 B

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