retriever

package
v0.0.0-...-ec75c2a Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 11 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 EventRetrieverMock

type EventRetrieverMock struct {
	mock.Mock
}

EventRetrieverMock is an autogenerated mock type for the EventRetriever type

func NewEventRetrieverMock

func NewEventRetrieverMock(t NewEventRetrieverMockT) *EventRetrieverMock

NewEventRetrieverMock creates a new instance of EventRetrieverMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*EventRetrieverMock) GetEvents

func (_m *EventRetrieverMock) GetEvents(blockHash types.Hash) ([]*parser.Event, error)

GetEvents provides a mock function with given fields: blockHash

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.

type ExtrinsicRetrieverMock

type ExtrinsicRetrieverMock struct {
	mock.Mock
}

ExtrinsicRetrieverMock is an autogenerated mock type for the ExtrinsicRetriever type

func NewExtrinsicRetrieverMock

func NewExtrinsicRetrieverMock(t NewExtrinsicRetrieverMockT) *ExtrinsicRetrieverMock

NewExtrinsicRetrieverMock creates a new instance of ExtrinsicRetrieverMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*ExtrinsicRetrieverMock) GetExtrinsics

func (_m *ExtrinsicRetrieverMock) GetExtrinsics(blockHash types.Hash) ([]*registry.DecodedExtrinsic, error)

GetExtrinsics provides a mock function with given fields: blockHash

type NewEventRetrieverMockT

type NewEventRetrieverMockT interface {
	mock.TestingT
	Cleanup(func())
}

type NewExtrinsicRetrieverMockT

type NewExtrinsicRetrieverMockT interface {
	mock.TestingT
	Cleanup(func())
}

Jump to

Keyboard shortcuts

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