Documentation
¶
Index ¶
- type CollectionsReader
- type EventsReader
- func (e *EventsReader) ByBlockID(blockID flow.Identifier) ([]flow.Event, error)
- func (e *EventsReader) ByBlockIDEventType(blockID flow.Identifier, eventType flow.EventType) ([]flow.Event, error)
- func (e *EventsReader) ByBlockIDTransactionID(blockID flow.Identifier, txID flow.Identifier) ([]flow.Event, error)
- func (e *EventsReader) ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) ([]flow.Event, error)
- type LightTransactionResultsReader
- func (l *LightTransactionResultsReader) ByBlockID(id flow.Identifier) ([]flow.LightTransactionResult, error)
- func (l *LightTransactionResultsReader) ByBlockIDTransactionID(blockID flow.Identifier, transactionID flow.Identifier) (*flow.LightTransactionResult, error)
- func (l *LightTransactionResultsReader) ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) (*flow.LightTransactionResult, error)
- type RegistersReader
- type TransactionResultErrorMessagesReader
- func (t *TransactionResultErrorMessagesReader) ByBlockID(id flow.Identifier) ([]flow.TransactionResultErrorMessage, error)
- func (t *TransactionResultErrorMessagesReader) ByBlockIDTransactionID(blockID flow.Identifier, transactionID flow.Identifier) (*flow.TransactionResultErrorMessage, error)
- func (t *TransactionResultErrorMessagesReader) ByBlockIDTransactionIndex(blockID flow.Identifier, txIndex uint32) (*flow.TransactionResultErrorMessage, error)
- func (t *TransactionResultErrorMessagesReader) Exists(blockID flow.Identifier) (bool, error)
- type TransactionsReader
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:
- storage.ErrNotFound if no light collection was found.
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:
- storage.ErrNotFound if no light collection was found.
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:
- storage.ErrNotFound if no light collection was found.
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:
- storage.ErrNotFound if no events were found at given block.
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:
- storage.ErrNotFound if no events were found at given block.
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:
- storage.ErrNotFound if no events were found at given block and transaction.
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:
- storage.ErrNotFound if no events were found at given block and transaction.
type LightTransactionResultsReader ¶
type LightTransactionResultsReader struct {
// contains filtered or unexported fields
}
func NewLightTransactionResults ¶
func NewLightTransactionResults(blockID flow.Identifier, results []flow.LightTransactionResult) *LightTransactionResultsReader
func (*LightTransactionResultsReader) ByBlockID ¶
func (l *LightTransactionResultsReader) ByBlockID(id flow.Identifier) ([]flow.LightTransactionResult, error)
ByBlockID gets all transaction results for a block, ordered by transaction index
Expected error returns during normal operation:
- storage.ErrNotFound if light transaction results at given blockID weren't found.
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:
- storage.ErrNotFound if light transaction result at given blockID wasn't found.
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:
- storage.ErrNotFound if light transaction result at given blockID and txIndex wasn't found.
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 NewTransactionResultErrorMessages ¶
func NewTransactionResultErrorMessages(blockID flow.Identifier, errMessages []flow.TransactionResultErrorMessage) *TransactionResultErrorMessagesReader
func (*TransactionResultErrorMessagesReader) ByBlockID ¶
func (t *TransactionResultErrorMessagesReader) 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 error returns during normal operation:
- storage.ErrNotFound if no block was found.
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 ¶
func (t *TransactionResultErrorMessagesReader) Exists(blockID flow.Identifier) (bool, error)
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 ¶
func (t *TransactionsReader) ByID(txID flow.Identifier) (*flow.TransactionBody, error)
ByID returns the transaction for the given fingerprint.
Expected error returns during normal operation:
- storage.ErrNotFound if no transaction with provided ID was found.