parser

package
v9.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrEventsCountDecoding  = libErr.Error("events count decoding")
	ErrEventPhaseDecoding   = libErr.Error("event phase decoding")
	ErrEventIDDecoding      = libErr.Error("event ID decoding")
	ErrEventDecoderNotFound = libErr.Error("event decoder not found")
	ErrEventFieldsDecoding  = libErr.Error("event fields decoding")
	ErrEventTopicsDecoding  = libErr.Error("event topics decoding")
	ErrCallDecoderNotFound  = libErr.Error("call decoder not found")
	ErrCallFieldsDecoding   = libErr.Error("call fields decoding")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultExtrinsic

DefaultExtrinsic is the Extrinsic with defaults for the generic types:

Address - types.MultiAddress Signature - types.MultiSignature PaymentFields - generic.DefaultPaymentFields

type DefaultExtrinsicParser

DefaultExtrinsicParser is the ExtrinsicParser interface with defaults for the generic types:

Address - types.MultiAddress Signature - types.MultiSignature PaymentFields - generic.DefaultPaymentFields

func NewDefaultExtrinsicParser

func NewDefaultExtrinsicParser() DefaultExtrinsicParser

NewDefaultExtrinsicParser returns a DefaultExtrinsicParser.

type Event

type Event struct {
	Name    string
	Fields  registry.DecodedFields
	EventID types.EventID
	Phase   *types.Phase
	Topics  []types.Hash
}

Event holds all the information of a decoded storage event.

type EventParser

type EventParser interface {
	ParseEvents(eventRegistry registry.EventRegistry, sd *types.StorageDataRaw) ([]*Event, error)
}

EventParser is the interface used for parsing event storage data into []*Event.

func NewEventParser

func NewEventParser() EventParser

NewEventParser creates a new EventParser.

type EventParserFn

type EventParserFn func(eventRegistry registry.EventRegistry, sd *types.StorageDataRaw) ([]*Event, error)

EventParserFn implements EventParser.

func (EventParserFn) ParseEvents

func (f EventParserFn) ParseEvents(eventRegistry registry.EventRegistry, sd *types.StorageDataRaw) ([]*Event, error)

ParseEvents is the function required for satisfying the EventParser interface.

type EventParserMock

type EventParserMock struct {
	mock.Mock
}

EventParserMock is an autogenerated mock type for the EventParser type

func NewEventParserMock

func NewEventParserMock(t NewEventParserMockT) *EventParserMock

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

func (*EventParserMock) ParseEvents

func (_m *EventParserMock) ParseEvents(eventRegistry registry.EventRegistry, sd *types.StorageDataRaw) ([]*Event, error)

ParseEvents provides a mock function with given fields: eventRegistry, sd

type Extrinsic

type Extrinsic[A, S, P any] struct {
	Name       string
	CallFields registry.DecodedFields
	CallIndex  types.CallIndex
	Version    byte
	Signature  generic.GenericExtrinsicSignature[A, S, P]
}

Extrinsic holds all the information of a decoded block extrinsic.

This type is generic over types A, S, P, please check generic.GenericExtrinsicSignature for more information about these generic types.

type ExtrinsicParser

type ExtrinsicParser[A, S, P any] interface {
	ParseExtrinsics(callRegistry registry.CallRegistry, block generic.GenericSignedBlock[A, S, P]) ([]*Extrinsic[A, S, P], error)
}

ExtrinsicParser is the interface used for parsing a block's extrinsics into []*Extrinsic.

This interface is generic over types A, S, P, please check generic.GenericExtrinsicSignature for more information about these generic types.

func NewExtrinsicParser

func NewExtrinsicParser[A, S, P any]() ExtrinsicParser[A, S, P]

NewExtrinsicParser creates a new ExtrinsicParser.

type ExtrinsicParserFn

type ExtrinsicParserFn[A, S, P any] func(callRegistry registry.CallRegistry, block generic.GenericSignedBlock[A, S, P]) ([]*Extrinsic[A, S, P], error)

ExtrinsicParserFn implements ExtrinsicParser.

func (ExtrinsicParserFn[A, S, P]) ParseExtrinsics

func (e ExtrinsicParserFn[A, S, P]) ParseExtrinsics(callRegistry registry.CallRegistry, block generic.GenericSignedBlock[A, S, P]) ([]*Extrinsic[A, S, P], error)

ParseExtrinsics is the function required for satisfying the ExtrinsicParser interface.

type ExtrinsicParserMock

type ExtrinsicParserMock[A interface{}, S interface{}, P interface{}] struct {
	mock.Mock
}

ExtrinsicParserMock is an autogenerated mock type for the ExtrinsicParser type

func NewExtrinsicParserMock

func NewExtrinsicParserMock[A interface{}, S interface{}, P interface{}](t NewExtrinsicParserMockT) *ExtrinsicParserMock[A, S, P]

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

func (*ExtrinsicParserMock[A, S, P]) ParseExtrinsics

func (_m *ExtrinsicParserMock[A, S, P]) ParseExtrinsics(callRegistry registry.CallRegistry, block generic.GenericSignedBlock[A, S, P]) ([]*Extrinsic[A, S, P], error)

ParseExtrinsics provides a mock function with given fields: callRegistry, block

type NewEventParserMockT

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

type NewExtrinsicParserMockT

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

Jump to

Keyboard shortcuts

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