inmemory

package
v0.43.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionsReader

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

func NewCollections

func NewCollections(collections []*flow.Collection) *CollectionsReader

func (*CollectionsReader) ByID

func (c *CollectionsReader) ByID(collID flow.Identifier) (*flow.Collection, error)

ByID returns the collection with the given ID, including all transactions within the collection.

Expected error returns during normal operation:

func (*CollectionsReader) LightByID

func (c *CollectionsReader) LightByID(collID flow.Identifier) (*flow.LightCollection, error)

LightByID returns collection with the given ID. Only retrieves transaction hashes.

Expected error returns during normal operation:

func (*CollectionsReader) LightByTransactionID

func (c *CollectionsReader) LightByTransactionID(txID flow.Identifier) (*flow.LightCollection, error)

LightByTransactionID returns the collection for the given transaction ID. Only retrieves transaction hashes.

Expected error returns during normal operation:

type EventsReader

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

func NewEvents

func NewEvents(blockID flow.Identifier, events []flow.Event) *EventsReader

func (*EventsReader) ByBlockID

func (e *EventsReader) ByBlockID(blockID flow.Identifier) ([]flow.Event, error)

ByBlockID returns the events for the given block ID.

Expected error returns during normal operation:

func (*EventsReader) ByBlockIDEventType

func (e *EventsReader) ByBlockIDEventType(blockID flow.Identifier, eventType flow.EventType) ([]flow.Event, error)

ByBlockIDEventType returns the events for the given block ID and event type.

Expected error returns during normal operation:

func (*EventsReader) ByBlockIDTransactionID

func (e *EventsReader) ByBlockIDTransactionID(blockID flow.Identifier, txID flow.Identifier) ([]flow.Event, error)

ByBlockIDTransactionID returns the events for the given block ID and transaction ID.

Expected error returns during normal operation:

func (*EventsReader) ByBlockIDTransactionIndex

func (e *EventsReader) ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) ([]flow.Event, error)

ByBlockIDTransactionIndex returns the events for the transaction at given index in a given block

Expected error returns during normal operation:

type LightTransactionResultsReader

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

func NewLightTransactionResults

func NewLightTransactionResults(blockID flow.Identifier, results []flow.LightTransactionResult) *LightTransactionResultsReader

func (*LightTransactionResultsReader) ByBlockID

ByBlockID gets all transaction results for a block, ordered by transaction index

Expected error returns during normal operation:

func (*LightTransactionResultsReader) ByBlockIDTransactionID

func (l *LightTransactionResultsReader) ByBlockIDTransactionID(blockID flow.Identifier, transactionID flow.Identifier) (*flow.LightTransactionResult, error)

ByBlockIDTransactionID returns the transaction result for the given block ID and transaction

Expected error returns during normal operation:

func (*LightTransactionResultsReader) ByBlockIDTransactionIndex

func (l *LightTransactionResultsReader) ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) (*flow.LightTransactionResult, error)

ByBlockIDTransactionIndex returns the transaction result for the given blockID and transaction index

Expected error returns during normal operation:

type RegistersReader

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

RegistersReader is a simple in-memory implementation of the RegisterIndexReader interface. It stores registers for a single block height.

func NewRegisters

func NewRegisters(blockHeight uint64, registers []flow.RegisterEntry) *RegistersReader

func (*RegistersReader) FirstHeight

func (r *RegistersReader) FirstHeight() uint64

FirstHeight returns the first indexed height found in the store.

func (*RegistersReader) Get

func (r *RegistersReader) Get(registerID flow.RegisterID, height uint64) (flow.RegisterValue, error)

Get returns a register by the register ID at a storage's block height.

Expected error returns during normal operation: - storage.ErrNotFound if the register does not exist in this storage object - storage.ErrHeightNotIndexed if the given height does not match the storage's block height

func (*RegistersReader) LatestHeight

func (r *RegistersReader) LatestHeight() uint64

LatestHeight returns the latest indexed height.

type TransactionResultErrorMessagesReader

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

func (*TransactionResultErrorMessagesReader) ByBlockID

ByBlockID gets all transaction result error messages for a block, ordered by transaction index. Note: This method will return an empty slice both if the block is not indexed yet and if the block does not have any errors.

Expected error returns during normal operation:

func (*TransactionResultErrorMessagesReader) ByBlockIDTransactionID

func (t *TransactionResultErrorMessagesReader) ByBlockIDTransactionID(
	blockID flow.Identifier,
	transactionID flow.Identifier,
) (*flow.TransactionResultErrorMessage, error)

ByBlockIDTransactionID returns the transaction result error message for the given block ID and transaction ID.

Expected error returns during normal operation:

  • storage.ErrNotFound if no transaction error message is known at given block and transaction id.

func (*TransactionResultErrorMessagesReader) ByBlockIDTransactionIndex

func (t *TransactionResultErrorMessagesReader) ByBlockIDTransactionIndex(
	blockID flow.Identifier,
	txIndex uint32,
) (*flow.TransactionResultErrorMessage, error)

ByBlockIDTransactionIndex returns the transaction result error message for the given blockID and transaction index.

Expected error returns during normal operation:

  • storage.ErrNotFound if no transaction error message is known at given block and transaction index.

func (*TransactionResultErrorMessagesReader) Exists

Exists returns true if transaction result error messages for the given ID have been stored.

No error returns are expected during normal operation.

type TransactionsReader

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

func NewTransactions

func NewTransactions(transactions []*flow.TransactionBody) *TransactionsReader

func (*TransactionsReader) ByID

ByID returns the transaction for the given fingerprint.

Expected error returns during normal operation:

Jump to

Keyboard shortcuts

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