provider

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: GPL-3.0 Imports: 42 Imported by: 0

Documentation

Overview

Package provider implements the cchain.Provider interface.

Index

Constants

This section is empty.

Variables

View Source
var ErrHistoryPruned = errors.New("no commit info found (history pruned)")

ErrHistoryPruned indicates that the necessary state for the requested height isn't found in the store.

Functions

func IsErrHistoryPruned

func IsErrHistoryPruned(err error) bool

IsErrHistoryPruned reports whether the input error matches the CosmosSDK errors returned when the state for the requested height isn't found in the store.

Types

type Provider

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

Provider implements cchain.Provider.

func Dial

func Dial(network netconf.ID) (Provider, error)

func NewABCIProvider

func NewABCIProvider(cmtCl rpcclient.Client, 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) AllAttestationsFrom

func (p Provider) AllAttestationsFrom(ctx context.Context, chainVer xchain.ChainVersion, attestOffset uint64,
) ([]xchain.Attestation, error)

func (Provider) AppliedPlan added in v0.9.0

func (p Provider) AppliedPlan(ctx context.Context, name string) (upgradetypes.Plan, bool, error)

func (Provider) AttestationsFrom

func (p Provider) AttestationsFrom(ctx context.Context, chainVer xchain.ChainVersion, attestOffset uint64,
) ([]xchain.Attestation, error)

func (Provider) CometClient

func (p Provider) CometClient() rpcclient.Client

func (Provider) CurrentPlannedPlan added in v0.9.0

func (p Provider) CurrentPlannedPlan(ctx context.Context) (upgradetypes.Plan, bool, error)

func (Provider) GenesisFiles

func (p Provider) GenesisFiles(ctx context.Context) (execution []byte, consensus []byte, err error)

func (Provider) LatestAttestation

func (p Provider) LatestAttestation(ctx context.Context, chainVer xchain.ChainVersion,
) (xchain.Attestation, bool, error)

func (Provider) PortalValidatorSet

func (p Provider) PortalValidatorSet(ctx context.Context, valSetID uint64) ([]cchain.PortalValidator, bool, error)

func (Provider) Portals

func (p Provider) Portals(ctx context.Context) ([]*rtypes.Portal, bool, error)

func (Provider) SDKRewards

func (p Provider) SDKRewards(ctx context.Context, operator common.Address) (float64, bool, error)

func (Provider) SDKSigningInfos

func (p Provider) SDKSigningInfos(ctx context.Context) ([]cchain.SDKSigningInfo, error)

func (Provider) SDKValidator

func (p Provider) SDKValidator(ctx context.Context, operator common.Address) (cchain.SDKValidator, bool, error)

func (Provider) SDKValidators

func (p Provider) SDKValidators(ctx context.Context) ([]cchain.SDKValidator, error)

func (Provider) StreamAsync

func (p Provider) StreamAsync(
	ctx context.Context,
	chainVer xchain.ChainVersion,
	attestOffset uint64,
	workerName string,
	callback cchain.ProviderCallback,
)

func (Provider) StreamAttestations

func (p Provider) StreamAttestations(
	ctx context.Context,
	chainVer xchain.ChainVersion,
	attestOffset uint64,
	workerName string,
	callback cchain.ProviderCallback,
) error

func (Provider) WindowCompare

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

func (Provider) XBlock

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