Documentation
¶
Index ¶
- type Collections
- func (c *Collections) ByID(collID flow.Identifier) (*flow.Collection, error)
- func (c *Collections) LightByID(collID flow.Identifier) (*flow.LightCollection, error)
- func (c *Collections) LightByTransactionID(txID flow.Identifier) (*flow.LightCollection, error)
- func (c *Collections) Remove(collID flow.Identifier) error
- func (c *Collections) Store(collection *flow.Collection) error
- func (c *Collections) StoreLightAndIndexByTransaction(collection *flow.LightCollection) error
- type Events
- func (e *Events) BatchRemoveByBlockID(flow.Identifier, storage.ReaderBatchWriter) error
- func (e *Events) BatchStore(flow.Identifier, []flow.EventsList, storage.ReaderBatchWriter) error
- func (e *Events) ByBlockID(blockID flow.Identifier) ([]flow.Event, error)
- func (e *Events) ByBlockIDEventType(blockID flow.Identifier, eventType flow.EventType) ([]flow.Event, error)
- func (e *Events) ByBlockIDTransactionID(blockID flow.Identifier, txID flow.Identifier) ([]flow.Event, error)
- func (e *Events) ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) ([]flow.Event, error)
- func (e *Events) Store(blockID flow.Identifier, blockEvents []flow.EventsList) error
- type LightTransactionResults
- func (l *LightTransactionResults) BatchStore(flow.Identifier, []flow.LightTransactionResult, storage.ReaderBatchWriter) error
- func (l *LightTransactionResults) BatchStoreBadger(flow.Identifier, []flow.LightTransactionResult, storage.BatchStorage) error
- func (l *LightTransactionResults) ByBlockID(id flow.Identifier) ([]flow.LightTransactionResult, error)
- func (l *LightTransactionResults) ByBlockIDTransactionID(blockID flow.Identifier, transactionID flow.Identifier) (*flow.LightTransactionResult, error)
- func (l *LightTransactionResults) ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) (*flow.LightTransactionResult, error)
- func (l *LightTransactionResults) Store(blockID flow.Identifier, transactionResults []flow.LightTransactionResult) error
- type Registers
- type TransactionResultErrorMessages
- func (t *TransactionResultErrorMessages) ByBlockID(id flow.Identifier) ([]flow.TransactionResultErrorMessage, error)
- func (t *TransactionResultErrorMessages) ByBlockIDTransactionID(blockID flow.Identifier, transactionID flow.Identifier) (*flow.TransactionResultErrorMessage, error)
- func (t *TransactionResultErrorMessages) ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) (*flow.TransactionResultErrorMessage, error)
- func (t *TransactionResultErrorMessages) Exists(blockID flow.Identifier) (bool, error)
- func (t *TransactionResultErrorMessages) Store(blockID flow.Identifier, ...) error
- type Transactions
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 (*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 ¶
func (e *Events) BatchStore(flow.Identifier, []flow.EventsList, storage.ReaderBatchWriter) error
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 ¶
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 ¶
func (l *LightTransactionResults) BatchStore(flow.Identifier, []flow.LightTransactionResult, storage.ReaderBatchWriter) error
BatchStore inserts a batch of transaction result into a batch. This method is not implemented and will always return an error.
func (*LightTransactionResults) BatchStoreBadger ¶
func (l *LightTransactionResults) BatchStoreBadger(flow.Identifier, []flow.LightTransactionResult, storage.BatchStorage) error
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 ¶
func (l *LightTransactionResults) ByBlockID(id flow.Identifier) ([]flow.LightTransactionResult, error)
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 (*Registers) FirstHeight ¶
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 ¶
LatestHeight returns the latest indexed height.
type TransactionResultErrorMessages ¶
type TransactionResultErrorMessages struct {
// contains filtered or unexported fields
}
func NewTransactionResultErrorMessages ¶
func NewTransactionResultErrorMessages() *TransactionResultErrorMessages
func (*TransactionResultErrorMessages) ByBlockID ¶
func (t *TransactionResultErrorMessages) ByBlockID(id flow.Identifier) ([]flow.TransactionResultErrorMessage, error)
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 ¶
func (t *TransactionResultErrorMessages) Exists(blockID flow.Identifier) (bool, error)
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 ¶
func (t *Transactions) ByID(txID flow.Identifier) (*flow.TransactionBody, error)
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.