provider

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: GPL-3.0 Imports: 30 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, chains map[uint64]string) Provider

func NewProviderForT

func NewProviderForT(_ *testing.T, fetch fetchFunc, latest latestFunc, window windowFunc,
	backoffFunc func(context.Context) (func(), func()),
) Provider

NewProviderForT creates a new provider for testing.

func (Provider) AttestationsFrom

func (p Provider) AttestationsFrom(ctx context.Context, sourceChainID uint64, sourceHeight uint64,
) ([]xchain.Attestation, error)

func (Provider) LatestAttestation

func (p Provider) LatestAttestation(ctx context.Context, sourceChainID uint64,
) (xchain.Attestation, bool, error)

func (Provider) Subscribe added in v0.1.0

func (p Provider) Subscribe(in context.Context, srcChainID uint64, height 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, sourceChainID uint64, height uint64) (int, error)

func (Provider) XBlock

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

XBlock returns the valsync XBlock at the given height or latest, or false if not available, or an error. The height is equivalent to the validator set id.

Jump to

Keyboard shortcuts

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