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