retriever

package
v1.4.557 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrInternalStateUpdate      = libErr.Error("internal state update")
	ErrBlockRetrieval           = libErr.Error("block retrieval")
	ErrExtrinsicDecoding        = libErr.Error("extrinsic parsing")
	ErrMetadataRetrieval        = libErr.Error("metadata retrieval")
	ErrExtrinsicDecoderCreation = libErr.Error("extrinsic decoder creation")
	ErrStorageEventRetrieval    = libErr.Error("storage event retrieval")
	ErrEventParsing             = libErr.Error("event parsing")
	ErrEventRegistryCreation    = libErr.Error("event registry creation")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventRetriever

type EventRetriever interface {
	GetEvents(blockHash types.Hash) ([]*parser.Event, error)
}

EventRetriever is the interface used for retrieving and decoding events.

func NewDefaultEventRetriever

func NewDefaultEventRetriever(
	eventProvider regState.EventProvider,
	stateRPC state.State,
	fieldOverrides ...registry.FieldOverride,
) (EventRetriever, error)

NewDefaultEventRetriever creates a new EventRetriever using defaults for:

- parser.EventParser - registry.Factory - exec.RetryableExecutor - used for retrieving event storage data. - exec.RetryableExecutor - used for parsing events.

func NewEventRetriever

func NewEventRetriever(
	eventParser parser.EventParser,
	eventProvider regState.EventProvider,
	stateRPC state.State,
	registryFactory registry.Factory,
	eventStorageExecutor exec.RetryableExecutor[*types.StorageDataRaw],
	eventParsingExecutor exec.RetryableExecutor[[]*parser.Event],
) (EventRetriever, error)

NewEventRetriever creates a new EventRetriever.

type ExtrinsicRetriever

type ExtrinsicRetriever interface {
	GetExtrinsics(blockHash types.Hash) ([]*registry.DecodedExtrinsic, error)
}

ExtrinsicRetriever is the interface used for retrieving and decoding extrinsic information from a particular block.

func NewDefaultExtrinsicRetriever

func NewDefaultExtrinsicRetriever(
	chainRPC chain.Chain,
	stateRPC state.State,
	fieldOverrides ...registry.FieldOverride,
) (ExtrinsicRetriever, error)

NewDefaultExtrinsicRetriever returns an ExtrinsicRetriever with default values for the factory and executors.

func NewExtrinsicRetriever

func NewExtrinsicRetriever(
	chainRPC chain.Chain,
	stateRPC state.State,
	registryFactory registry.Factory,
	chainExecutor exec.RetryableExecutor[*block.SignedBlock],
	extrinsicDecodingExecutor exec.RetryableExecutor[[]*registry.DecodedExtrinsic],
) (ExtrinsicRetriever, error)

NewExtrinsicRetriever creates a new ExtrinsicRetriever.

Jump to

Keyboard shortcuts

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