github.com/soomindae/tendermint@v0.0.5-0.20210528140126-84a0c70c8162/light/provider/provider.go (about) 1 package provider 2 3 import ( 4 "context" 5 6 "github.com/soomindae/tendermint/types" 7 ) 8 9 // Provider provides information for the light client to sync (verification 10 // happens in the client). 11 type Provider interface { 12 // ChainID returns the blockchain ID. 13 ChainID() string 14 15 // LightBlock returns the LightBlock that corresponds to the given 16 // height. 17 // 18 // 0 - the latest. 19 // height must be >= 0. 20 // 21 // If the provider fails to fetch the LightBlock due to the IO or other 22 // issues, an error will be returned. 23 // If there's no LightBlock for the given height, ErrLightBlockNotFound 24 // error is returned. 25 LightBlock(ctx context.Context, height int64) (*types.LightBlock, error) 26 27 // ReportEvidence reports an evidence of misbehavior. 28 ReportEvidence(context.Context, types.Evidence) error 29 }