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.

34 lines
782 B

  1. package mock
  2. import (
  3. "errors"
  4. "github.com/tendermint/tendermint/lite2/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) SignedHeader(height int64) (*types.SignedHeader, error) {
  18. return nil, errNoResp
  19. }
  20. func (p *deadMock) ValidatorSet(height int64) (*types.ValidatorSet, error) {
  21. return nil, errNoResp
  22. }
  23. func (p *deadMock) ReportEvidence(ev types.Evidence) error {
  24. return errNoResp
  25. }