provider

package
v0.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: GPL-3.0 Imports: 18 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 FetchFunc

type FetchFunc func(ctx context.Context, chainID uint64, fromHeight uint64,
) ([]xchain.Attestation, error)

FetchFunc abstracts fetching attestations from the consensus chain.

type LatestFunc

type LatestFunc func(ctx context.Context, chainID uint64) (xchain.Attestation, bool, error)

LatestFunc abstracts fetching the latest attestation from the consensus chain.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements cchain.Provider.

func NewABCIProvider

func NewABCIProvider(abci rpcclient.ABCIClient, 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

func (p Provider) Subscribe(in context.Context, srcChainID uint64, height uint64, workerName string,
	callback cchain.ProviderCallback,
)

Subscribe implements cchain.Provider.

func (Provider) WindowCompare

func (p Provider) WindowCompare(ctx context.Context, sourceChainID uint64, height uint64) (int, error)

type WindowFunc

type WindowFunc func(ctx context.Context, chainID uint64, height uint64) (int, error)

Jump to

Keyboard shortcuts

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