provider

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2024 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Package provider implements the cchain.Provider interface.

Index

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

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 (p Provider) ValidatorSet(ctx context.Context, valSetID uint64) ([]cchain.Validator, bool, error)

func (Provider) WindowCompare

func (p Provider) WindowCompare(ctx context.Context, chainVer xchain.ChainVersion, xBlockOffset uint64) (int, error)

func (Provider) XBlock added in v0.1.2

func (p Provider) XBlock(ctx context.Context, height uint64, latest bool) (xchain.Block, bool, error)

XBlock returns the consensus XBlock at the given height/offset or latest, or false if not available, or an error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL