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.

33 lines
706 B

  1. package mock
  2. import (
  3. "errors"
  4. "github.com/tendermint/tendermint/lite2/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 {
  15. return p.chainID
  16. }
  17. func (p *deadMock) String() string {
  18. return "deadMock"
  19. }
  20. func (p *deadMock) SignedHeader(height int64) (*types.SignedHeader, error) {
  21. return nil, errors.New("no response from provider")
  22. }
  23. func (p *deadMock) ValidatorSet(height int64) (*types.ValidatorSet, error) {
  24. return nil, errors.New("no response from provider")
  25. }