unsynchronized

package
v0.41.1-data-migration... Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collections

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

func NewCollections

func NewCollections() *Collections

func (*Collections) ByID

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

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

Expected errors during normal operation:

  • `storage.ErrNotFound` if no light collection was found.

func (*Collections) LightByID

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

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

Expected errors during normal operation:

  • `storage.ErrNotFound` if no light collection was found.

func (*Collections) LightByTransactionID

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

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

Expected errors during normal operation:

  • `storage.ErrNotFound` if no light collection was found.

func (*Collections) Remove

func (c *Collections) Remove(collID flow.Identifier) error

Remove removes the collection and all constituent transactions. No errors are expected during normal operation.

func (*Collections) Store

func (c *Collections) Store(collection *flow.Collection) error

Store inserts the collection keyed by ID and all constituent transactions. No errors are expected during normal operation.

func (*Collections) StoreLightAndIndexByTransaction

func (c *Collections) StoreLightAndIndexByTransaction(collection *flow.LightCollection) error

StoreLightAndIndexByTransaction inserts the light collection (only transaction IDs) and adds a transaction id index for each of the transactions within the collection (transaction_id->collection_id).

NOTE: Currently it is possible in rare circumstances for two collections to be guaranteed which both contain the same transaction (see https://github.com/dapperlabs/flow-go/issues/3556). The second of these will revert upon reaching the execution node, so this doesn't impact the execution state, but it can result in the Access node processing two collections which both contain the same transaction (see https://github.com/dapperlabs/flow-go/issues/5337). To handle this, we skip indexing the affected transaction when inserting the transaction_id->collection_id index when an index for the transaction already exists.

No errors are expected during normal operation.

type Events

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

func NewEvents

func NewEvents() *Events

func (*Events) BatchRemoveByBlockID

func (e *Events) BatchRemoveByBlockID(flow.Identifier, storage.ReaderBatchWriter) error

BatchRemoveByBlockID removes events keyed by a blockID in provided batch No errors are expected during normal operation, even if no entries are matched. If database unexpectedly fails to process the request, the error is wrapped in a generic error and returned.

This method is NOT implemented and will always return an error.

func (*Events) BatchStore

BatchStore will store events for the given block ID in a given batch.

This method is NOT implemented and will always return an error.

func (*Events) ByBlockID

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

ByBlockID returns the events for the given block ID.

Expected errors during normal operation:

  • `storage.ErrNotFound` if no events were found at given block.

func (*Events) ByBlockIDEventType

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

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

Expected errors during normal operation:

  • `storage.ErrNotFound` if no events were found at given block.

func (*Events) ByBlockIDTransactionID

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

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

Expected errors during normal operation:

  • `storage.ErrNotFound` if no events were found at given block and transaction.

func (*Events) ByBlockIDTransactionIndex

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

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

Expected errors during normal operation:

  • `storage.ErrNotFound` if no events were found at given block and transaction.

func (*Events) Store

func (e *Events) Store(blockID flow.Identifier, blockEvents []flow.EventsList) error

Store will store events for the given block ID. No errors are expected during normal operation.

type LightTransactionResults

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

func NewLightTransactionResults

func NewLightTransactionResults() *LightTransactionResults

func (*LightTransactionResults) BatchStore

BatchStore inserts a batch of transaction result into a batch. This method is not implemented and will always return an error.

func (*LightTransactionResults) BatchStoreBadger

BatchStoreBadger inserts a batch of transaction result into a storage. Deprecated: deprecated as a part of transition from Badger to Pebble. use BatchStore instead. This method is not implemented and will always return an error.

func (*LightTransactionResults) ByBlockID

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

Expected errors during normal operation:

  • `storage.ErrNotFound` if light transaction results at given blockID weren't found.

func (*LightTransactionResults) ByBlockIDTransactionID

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

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

Expected errors during normal operation:

  • `storage.ErrNotFound` if light transaction result at given blockID wasn't found.

func (*LightTransactionResults) ByBlockIDTransactionIndex

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

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

Expected errors during normal operation:

  • `storage.ErrNotFound` if light transaction result at given blockID and txIndex wasn't found.

func (*LightTransactionResults) Store

func (l *LightTransactionResults) Store(blockID flow.Identifier, transactionResults []flow.LightTransactionResult) error

Store inserts a transaction results into a storage No errors are expected during normal operation.

type Registers

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

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

func NewRegisters

func NewRegisters(blockHeight uint64) *Registers

func (*Registers) FirstHeight

func (r *Registers) FirstHeight() uint64

FirstHeight returns the first indexed height found in the store.

func (*Registers) Get

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

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

Expected errors: - 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 (*Registers) LatestHeight

func (r *Registers) LatestHeight() uint64

LatestHeight returns the latest indexed height.

func (*Registers) Store

func (r *Registers) Store(registers flow.RegisterEntries, height uint64) error

Store stores a batch of register entries at the storage's block height.

Expected errors: - storage.ErrHeightNotIndexed if the given height does not match the storage's block height.

type TransactionResultErrorMessages

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

func NewTransactionResultErrorMessages

func NewTransactionResultErrorMessages() *TransactionResultErrorMessages

func (*TransactionResultErrorMessages) 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 errors during normal operation:

  • `storage.ErrNotFound` if no block was found.

func (*TransactionResultErrorMessages) ByBlockIDTransactionID

func (t *TransactionResultErrorMessages) 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 errors during normal operation:

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

func (*TransactionResultErrorMessages) ByBlockIDTransactionIndex

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

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

Expected errors during normal operation:

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

func (*TransactionResultErrorMessages) Exists

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

No errors are expected during normal operation.

func (*TransactionResultErrorMessages) Store

func (t *TransactionResultErrorMessages) Store(
	blockID flow.Identifier,
	transactionResultErrorMessages []flow.TransactionResultErrorMessage,
) error

Store will store transaction result error messages for the given block ID.

No errors are expected during normal operation.

type Transactions

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

func NewTransactions

func NewTransactions() *Transactions

func (*Transactions) ByID

ByID returns the transaction for the given fingerprint. Expected errors during normal operation:

  • `storage.ErrNotFound` if transaction is not found.

func (*Transactions) Store

func (t *Transactions) Store(tx *flow.TransactionBody) error

Store inserts the transaction, keyed by fingerprint. Duplicate transaction insertion is ignored No errors are expected during normal operation.

Jump to

Keyboard shortcuts

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