provider

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSignedHeaderNotFound is returned when a provider can't find the
	// requested header.
	ErrSignedHeaderNotFound = errors.New("signed header not found")
	// ErrValidatorSetNotFound is returned when a provider can't find the
	// requested validator set.
	ErrValidatorSetNotFound = errors.New("validator set not found")
)

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// ChainID returns the blockchain ID.
	ChainID() string

	// SignedHeader returns the SignedHeader that corresponds to the given
	// height.
	//
	// 0 - the latest.
	// height must be >= 0.
	//
	// If the provider fails to fetch the SignedHeader due to the IO or other
	// issues, an error will be returned.
	// If there's no SignedHeader for the given height, ErrSignedHeaderNotFound
	// error is returned.
	SignedHeader(height int64) (*types.SignedHeader, error)

	// ValidatorSet returns the ValidatorSet that corresponds to height.
	//
	// 0 - the latest.
	// height must be >= 0.
	//
	// If the provider fails to fetch the ValidatorSet due to the IO or other
	// issues, an error will be returned.
	// If there's no ValidatorSet for the given height, ErrValidatorSetNotFound
	// error is returned.
	ValidatorSet(height int64) (*types.ValidatorSet, error)
}

Provider provides information for the lite client to sync (verification happens in the client).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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