Documentation ¶
Overview ¶
Package provider implements the cchain.Provider interface.
Index ¶
- type ABCIClient
- type Provider
- func (p Provider) AttestationsFrom(ctx context.Context, chainVer xchain.ChainVersion, xBlockOffset uint64) ([]xchain.Attestation, error)
- func (p Provider) LatestAttestation(ctx context.Context, chainVer xchain.ChainVersion) (xchain.Attestation, bool, error)
- func (p Provider) Subscribe(in context.Context, chainVer xchain.ChainVersion, xBlockOffset uint64, ...)
- func (p Provider) ValidatorSet(ctx context.Context, valSetID uint64) ([]cchain.Validator, bool, error)
- func (p Provider) WindowCompare(ctx context.Context, chainVer xchain.ChainVersion, xBlockOffset uint64) (int, error)
- func (p Provider) XBlock(ctx context.Context, height uint64, latest bool) (xchain.Block, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ABCIClient ¶ added in v0.1.2
type ABCIClient interface { rpcclient.ABCIClient rpcclient.SignClient }
ABCIClient abstracts the cometBFT RPC client consisting of only the required methods.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements cchain.Provider.
func NewABCIProvider ¶
func NewABCIProvider(abci ABCIClient, network netconf.ID, chainNamer func(xchain.ChainVersion) string) Provider
func NewProviderForT ¶
func NewProviderForT(_ *testing.T, fetch fetchFunc, latest latestFunc, window windowFunc, backoffFunc func(context.Context) func(), ) Provider
NewProviderForT creates a new provider for testing.
func (Provider) AttestationsFrom ¶
func (p Provider) AttestationsFrom(ctx context.Context, chainVer xchain.ChainVersion, xBlockOffset uint64, ) ([]xchain.Attestation, error)
func (Provider) LatestAttestation ¶
func (p Provider) LatestAttestation(ctx context.Context, chainVer xchain.ChainVersion, ) (xchain.Attestation, bool, error)
func (Provider) Subscribe ¶ added in v0.1.0
func (p Provider) Subscribe(in context.Context, chainVer xchain.ChainVersion, xBlockOffset uint64, workerName string, callback cchain.ProviderCallback, )
Subscribe implements cchain.Provider.
func (Provider) ValidatorSet ¶ added in v0.1.2
func (Provider) WindowCompare ¶
Click to show internal directories.
Click to hide internal directories.