 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
- type ENTransactionProvider
- func (e *ENTransactionProvider) ScheduledTransactionsByBlockID(ctx context.Context, header *flow.Header) ([]*flow.TransactionBody, error)
- func (e *ENTransactionProvider) TransactionResult(ctx context.Context, block *flow.Header, transactionID flow.Identifier, ...) (*accessmodel.TransactionResult, error)
- func (e *ENTransactionProvider) TransactionResultByIndex(ctx context.Context, block *flow.Block, index uint32, ...) (*accessmodel.TransactionResult, error)
- func (e *ENTransactionProvider) TransactionResultsByBlockID(ctx context.Context, block *flow.Block, ...) ([]*accessmodel.TransactionResult, error)
- func (e *ENTransactionProvider) TransactionsByBlockID(ctx context.Context, block *flow.Block) ([]*flow.TransactionBody, error)
 
- type FailoverTransactionProvider
- func (f *FailoverTransactionProvider) ScheduledTransactionsByBlockID(ctx context.Context, header *flow.Header) ([]*flow.TransactionBody, error)
- func (f *FailoverTransactionProvider) TransactionResult(ctx context.Context, header *flow.Header, txID flow.Identifier, ...) (*accessmodel.TransactionResult, error)
- func (f *FailoverTransactionProvider) TransactionResultByIndex(ctx context.Context, block *flow.Block, index uint32, ...) (*accessmodel.TransactionResult, error)
- func (f *FailoverTransactionProvider) TransactionResultsByBlockID(ctx context.Context, block *flow.Block, ...) ([]*accessmodel.TransactionResult, error)
- func (f *FailoverTransactionProvider) TransactionsByBlockID(ctx context.Context, block *flow.Block) ([]*flow.TransactionBody, error)
 
- type LocalTransactionProvider
- func (t *LocalTransactionProvider) ScheduledTransactionsByBlockID(ctx context.Context, header *flow.Header) ([]*flow.TransactionBody, error)
- func (t *LocalTransactionProvider) TransactionResult(ctx context.Context, header *flow.Header, transactionID flow.Identifier, ...) (*accessmodel.TransactionResult, error)
- func (t *LocalTransactionProvider) TransactionResultByIndex(ctx context.Context, block *flow.Block, index uint32, ...) (*accessmodel.TransactionResult, error)
- func (t *LocalTransactionProvider) TransactionResultsByBlockID(ctx context.Context, block *flow.Block, ...) ([]*accessmodel.TransactionResult, error)
- func (t *LocalTransactionProvider) TransactionsByBlockID(ctx context.Context, block *flow.Block) ([]*flow.TransactionBody, error)
 
- type TransactionProvider
Constants ¶
This section is empty.
Variables ¶
var ErrTransactionNotInBlock = errors.New("transaction not in block")
    ErrTransactionNotInBlock represents an error indicating that the transaction is not found in the block.
Functions ¶
This section is empty.
Types ¶
type ENTransactionProvider ¶
type ENTransactionProvider struct {
	// contains filtered or unexported fields
}
    func NewENTransactionProvider ¶
func NewENTransactionProvider( log zerolog.Logger, state protocol.State, collections storage.Collections, connFactory connection.ConnectionFactory, nodeCommunicator node_communicator.Communicator, execNodeIdentitiesProvider *rpc.ExecutionNodeIdentitiesProvider, txStatusDeriver *txstatus.TxStatusDeriver, systemCollection *system.SystemCollection, chainID flow.ChainID, scheduledTransactionsEnabled bool, ) *ENTransactionProvider
func (*ENTransactionProvider) ScheduledTransactionsByBlockID ¶
func (e *ENTransactionProvider) ScheduledTransactionsByBlockID( ctx context.Context, header *flow.Header, ) ([]*flow.TransactionBody, error)
ScheduledTransactionsByBlockID constructs the scheduled transaction bodies using events from the execution node response.
Expected error returns during normal operation:
- codes.Internal: if the scheduled transactions cannot be constructed
- status.Error: for any error returned by the execution node
func (*ENTransactionProvider) TransactionResult ¶
func (e *ENTransactionProvider) TransactionResult( ctx context.Context, block *flow.Header, transactionID flow.Identifier, collectionID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion, ) (*accessmodel.TransactionResult, error)
func (*ENTransactionProvider) TransactionResultByIndex ¶
func (e *ENTransactionProvider) TransactionResultByIndex( ctx context.Context, block *flow.Block, index uint32, collectionID flow.Identifier, encodingVersion entities.EventEncodingVersion, ) (*accessmodel.TransactionResult, error)
func (*ENTransactionProvider) TransactionResultsByBlockID ¶
func (e *ENTransactionProvider) TransactionResultsByBlockID( ctx context.Context, block *flow.Block, requiredEventEncodingVersion entities.EventEncodingVersion, ) ([]*accessmodel.TransactionResult, error)
func (*ENTransactionProvider) TransactionsByBlockID ¶
func (e *ENTransactionProvider) TransactionsByBlockID( ctx context.Context, block *flow.Block, ) ([]*flow.TransactionBody, error)
type FailoverTransactionProvider ¶
type FailoverTransactionProvider struct {
	// contains filtered or unexported fields
}
    func NewFailoverTransactionProvider ¶
func NewFailoverTransactionProvider(local TransactionProvider, execNode TransactionProvider) *FailoverTransactionProvider
func (*FailoverTransactionProvider) ScheduledTransactionsByBlockID ¶
func (f *FailoverTransactionProvider) ScheduledTransactionsByBlockID( ctx context.Context, header *flow.Header, ) ([]*flow.TransactionBody, error)
func (*FailoverTransactionProvider) TransactionResult ¶
func (f *FailoverTransactionProvider) TransactionResult( ctx context.Context, header *flow.Header, txID flow.Identifier, collectionID flow.Identifier, encodingVersion entities.EventEncodingVersion, ) (*accessmodel.TransactionResult, error)
func (*FailoverTransactionProvider) TransactionResultByIndex ¶
func (f *FailoverTransactionProvider) TransactionResultByIndex( ctx context.Context, block *flow.Block, index uint32, collectionID flow.Identifier, encodingVersion entities.EventEncodingVersion, ) (*accessmodel.TransactionResult, error)
func (*FailoverTransactionProvider) TransactionResultsByBlockID ¶
func (f *FailoverTransactionProvider) TransactionResultsByBlockID( ctx context.Context, block *flow.Block, encodingVersion entities.EventEncodingVersion, ) ([]*accessmodel.TransactionResult, error)
func (*FailoverTransactionProvider) TransactionsByBlockID ¶
func (f *FailoverTransactionProvider) TransactionsByBlockID( ctx context.Context, block *flow.Block, ) ([]*flow.TransactionBody, error)
type LocalTransactionProvider ¶
type LocalTransactionProvider struct {
	// contains filtered or unexported fields
}
    LocalTransactionProvider provides functionality for retrieving transaction results and error messages from local storages
func NewLocalTransactionProvider ¶
func NewLocalTransactionProvider( state protocol.State, collections storage.Collections, blocks storage.Blocks, eventsIndex *index.EventsIndex, txResultsIndex *index.TransactionResultsIndex, txErrorMessages error_messages.Provider, systemCollection *system.SystemCollection, txStatusDeriver *txstatus.TxStatusDeriver, chainID flow.ChainID, scheduledTransactionsEnabled bool, ) *LocalTransactionProvider
func (*LocalTransactionProvider) ScheduledTransactionsByBlockID ¶
func (t *LocalTransactionProvider) ScheduledTransactionsByBlockID( ctx context.Context, header *flow.Header, ) ([]*flow.TransactionBody, error)
ScheduledTransactionsByBlockID constructs the scheduled transaction bodies using events from the local storage.
Expected error returns during normal operation:
- codes.NotFound: if the events are not found for the block ID.
- codes.OutOfRange: if the events are not available for the block height.
- codes.FailedPrecondition: if the events index is not initialized.
- codes.Internal: if the scheduled transactions cannot be constructed.
func (*LocalTransactionProvider) TransactionResult ¶
func (t *LocalTransactionProvider) TransactionResult( ctx context.Context, header *flow.Header, transactionID flow.Identifier, collectionID flow.Identifier, encodingVersion entities.EventEncodingVersion, ) (*accessmodel.TransactionResult, error)
TransactionResult retrieves a transaction result from storage by block ID and transaction ID. Expected errors during normal operation:
- codes.NotFound when result cannot be provided by storage due to the absence of data.
- codes.Internal if event payload conversion failed.
- indexer.ErrIndexNotInitialized when txResultsIndex not initialized
- storage.ErrHeightNotIndexed when data is unavailable
All other errors are considered as state corruption (fatal) or internal errors in the transaction error message getter or when deriving transaction status.
func (*LocalTransactionProvider) TransactionResultByIndex ¶
func (t *LocalTransactionProvider) TransactionResultByIndex( ctx context.Context, block *flow.Block, index uint32, collectionID flow.Identifier, eventEncoding entities.EventEncodingVersion, ) (*accessmodel.TransactionResult, error)
TransactionResultByIndex retrieves a transaction result by index from storage. Expected errors during normal operation:
- codes.NotFound if result cannot be provided by storage due to the absence of data.
- codes.Internal when event payload conversion failed.
- indexer.ErrIndexNotInitialized when txResultsIndex not initialized
- storage.ErrHeightNotIndexed when data is unavailable
All other errors are considered as state corruption (fatal) or internal errors in the transaction error message getter or when deriving transaction status.
func (*LocalTransactionProvider) TransactionResultsByBlockID ¶
func (t *LocalTransactionProvider) TransactionResultsByBlockID( ctx context.Context, block *flow.Block, requiredEventEncodingVersion entities.EventEncodingVersion, ) ([]*accessmodel.TransactionResult, error)
TransactionResultsByBlockID retrieves transaction results by block ID from storage Expected errors during normal operation:
- codes.NotFound if result cannot be provided by storage due to the absence of data.
- codes.Internal when event payload conversion failed.
- indexer.ErrIndexNotInitialized when txResultsIndex not initialized
- storage.ErrHeightNotIndexed when data is unavailable
func (*LocalTransactionProvider) TransactionsByBlockID ¶
func (t *LocalTransactionProvider) TransactionsByBlockID( ctx context.Context, block *flow.Block, ) ([]*flow.TransactionBody, error)
TransactionsByBlockID retrieves transactions by block ID from storage Expected errors during normal operation:
- codes.NotFound if result cannot be provided by storage due to the absence of data.
- codes.Internal when event payload conversion failed.
- indexer.ErrIndexNotInitialized when txResultsIndex not initialized
- storage.ErrHeightNotIndexed when data is unavailable
All other errors are considered as state corruption (fatal) or internal errors in the transaction error message getter or when deriving transaction status.
type TransactionProvider ¶
type TransactionProvider interface {
	TransactionResult(
		ctx context.Context,
		header *flow.Header,
		txID flow.Identifier,
		collectionID flow.Identifier,
		encodingVersion entities.EventEncodingVersion,
	) (*accessmodel.TransactionResult, error)
	TransactionResultByIndex(
		ctx context.Context,
		block *flow.Block,
		index uint32,
		collectionID flow.Identifier,
		encodingVersion entities.EventEncodingVersion,
	) (*accessmodel.TransactionResult, error)
	TransactionResultsByBlockID(
		ctx context.Context,
		block *flow.Block,
		encodingVersion entities.EventEncodingVersion,
	) ([]*accessmodel.TransactionResult, error)
	TransactionsByBlockID(
		ctx context.Context,
		block *flow.Block,
	) ([]*flow.TransactionBody, error)
	ScheduledTransactionsByBlockID(
		ctx context.Context,
		header *flow.Header,
	) ([]*flow.TransactionBody, error)
}
    TransactionProvider defines an interface for retrieving transaction results from various data sources, such as local storage and execution nodes.