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.

32 lines
1014 B

  1. package lite
  2. import (
  3. log "github.com/tendermint/tendermint/libs/log"
  4. "github.com/tendermint/tendermint/types"
  5. )
  6. // Provider provides information for the lite client to sync validators.
  7. // Examples: MemProvider, files.Provider, client.Provider, CacheProvider.
  8. type Provider interface {
  9. // LatestFullCommit returns the latest commit with minHeight <= height <=
  10. // maxHeight.
  11. // If maxHeight is zero, returns the latest where minHeight <= height.
  12. LatestFullCommit(chainID string, minHeight, maxHeight int64) (FullCommit, error)
  13. // Get the valset that corresponds to chainID and height and return.
  14. // Height must be >= 1.
  15. ValidatorSet(chainID string, height int64) (*types.ValidatorSet, error)
  16. // Set a logger.
  17. SetLogger(logger log.Logger)
  18. }
  19. // A provider that can also persist new information.
  20. // Examples: MemProvider, files.Provider, CacheProvider.
  21. type PersistentProvider interface {
  22. Provider
  23. // SaveFullCommit saves a FullCommit (without verification).
  24. SaveFullCommit(fc FullCommit) error
  25. }