github.com/adoriasoft/tendermint@v0.34.0-dev1.0.20200722151356-96d84601a75a/light/provider/provider.go (about) 1 package provider 2 3 import ( 4 "github.com/tendermint/tendermint/types" 5 ) 6 7 // Provider provides information for the light client to sync (verification 8 // happens in the client). 9 type Provider interface { 10 // ChainID returns the blockchain ID. 11 ChainID() string 12 13 // SignedHeader returns the SignedHeader that corresponds to the given 14 // height. 15 // 16 // 0 - the latest. 17 // height must be >= 0. 18 // 19 // If the provider fails to fetch the SignedHeader due to the IO or other 20 // issues, an error will be returned. 21 // If there's no SignedHeader for the given height, ErrSignedHeaderNotFound 22 // error is returned. 23 SignedHeader(height int64) (*types.SignedHeader, error) 24 25 // ValidatorSet returns the ValidatorSet that corresponds to height. 26 // 27 // 0 - the latest. 28 // height must be >= 0. 29 // 30 // If the provider fails to fetch the ValidatorSet due to the IO or other 31 // issues, an error will be returned. 32 // If there's no ValidatorSet for the given height, ErrValidatorSetNotFound 33 // error is returned. 34 ValidatorSet(height int64) (*types.ValidatorSet, error) 35 36 // ReportEvidence reports an evidence of misbehavior. 37 ReportEvidence(ev types.Evidence) error 38 }