github.com/devwanda/aphelion-staking@v0.33.9/lite2/provider/provider.go (about) 1 package provider 2 3 import ( 4 "github.com/devwanda/aphelion-staking/types" 5 ) 6 7 // Provider provides information for the lite 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 }