Documentation
¶
Index ¶
- Variables
- type Params
- type Transactions
- func (t *Transactions) GetSystemTransaction(_ context.Context, _ flow.Identifier) (*flow.TransactionBody, error)
- func (t *Transactions) GetSystemTransactionResult(ctx context.Context, blockID flow.Identifier, ...) (*accessmodel.TransactionResult, error)
- func (t *Transactions) GetTransaction(ctx context.Context, txID flow.Identifier) (*flow.TransactionBody, error)
- func (t *Transactions) GetTransactionResult(ctx context.Context, txID flow.Identifier, blockID flow.Identifier, ...) (*accessmodel.TransactionResult, error)
- func (t *Transactions) GetTransactionResultByIndex(ctx context.Context, blockID flow.Identifier, index uint32, ...) (*accessmodel.TransactionResult, error)
- func (t *Transactions) GetTransactionResultsByBlockID(ctx context.Context, blockID flow.Identifier, ...) ([]*accessmodel.TransactionResult, error)
- func (t *Transactions) GetTransactionsByBlockID(_ context.Context, blockID flow.Identifier) ([]*flow.TransactionBody, error)
- func (t *Transactions) ProcessFinalizedBlockHeight(height uint64) error
- func (t *Transactions) SendRawTransaction(ctx context.Context, tx *flow.TransactionBody) error
- func (t *Transactions) SendTransaction(ctx context.Context, tx *flow.TransactionBody) error
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 Params ¶
type Params struct {
Log zerolog.Logger
Metrics module.TransactionMetrics
State protocol.State
ChainID flow.ChainID
SystemTxID flow.Identifier
SystemTx *flow.TransactionBody
StaticCollectionRPCClient accessproto.AccessAPIClient
HistoricalAccessNodeClients []accessproto.AccessAPIClient
NodeCommunicator node_communicator.Communicator
ConnFactory connection.ConnectionFactory
EnableRetries bool
NodeProvider *commonrpc.ExecutionNodeIdentitiesProvider
Blocks storage.Blocks
Collections storage.Collections
Transactions storage.Transactions
TxErrorMessageProvider error_messages.Provider
TxResultCache *lru.Cache[flow.Identifier, *accessmodel.TransactionResult]
TxProvider provider.TransactionProvider
TxValidator *validator.TransactionValidator
TxStatusDeriver *txstatus.TxStatusDeriver
EventsIndex *index.EventsIndex
TxResultsIndex *index.TransactionResultsIndex
}
type Transactions ¶
type Transactions struct {
// contains filtered or unexported fields
}
func NewTransactionsBackend ¶
func NewTransactionsBackend(params Params) (*Transactions, error)
func (*Transactions) GetSystemTransaction ¶
func (t *Transactions) GetSystemTransaction(_ context.Context, _ flow.Identifier) (*flow.TransactionBody, error)
GetSystemTransaction returns system transaction
func (*Transactions) GetSystemTransactionResult ¶
func (t *Transactions) GetSystemTransactionResult(ctx context.Context, blockID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) (*accessmodel.TransactionResult, error)
GetSystemTransactionResult returns system transaction result
func (*Transactions) GetTransaction ¶
func (t *Transactions) GetTransaction(ctx context.Context, txID flow.Identifier) (*flow.TransactionBody, error)
func (*Transactions) GetTransactionResult ¶
func (t *Transactions) GetTransactionResult( ctx context.Context, txID flow.Identifier, blockID flow.Identifier, collectionID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion, ) (*accessmodel.TransactionResult, error)
func (*Transactions) GetTransactionResultByIndex ¶
func (t *Transactions) GetTransactionResultByIndex( ctx context.Context, blockID flow.Identifier, index uint32, requiredEventEncodingVersion entities.EventEncodingVersion, ) (*accessmodel.TransactionResult, error)
GetTransactionResultByIndex returns transactions Results for an index in a block that is executed, pending or finalized transactions return errors
func (*Transactions) GetTransactionResultsByBlockID ¶
func (t *Transactions) GetTransactionResultsByBlockID( ctx context.Context, blockID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion, ) ([]*accessmodel.TransactionResult, error)
func (*Transactions) GetTransactionsByBlockID ¶
func (t *Transactions) GetTransactionsByBlockID( _ context.Context, blockID flow.Identifier, ) ([]*flow.TransactionBody, error)
func (*Transactions) ProcessFinalizedBlockHeight ¶
func (t *Transactions) ProcessFinalizedBlockHeight(height uint64) error
ATTENTION: might be a source of problems in future. We run this code on finalization gorotuine, potentially lagging finalization events if operations take long time. We might need to move this logic on dedicated goroutine and provide a way to skip finalization events if they are delivered too often for this engine. An example of similar approach - https://github.com/onflow/flow-go/blob/10b0fcbf7e2031674c00f3cdd280f27bd1b16c47/engine/common/follower/compliance_engine.go#L201.. No errors expected during normal operations.
func (*Transactions) SendRawTransaction ¶
func (t *Transactions) SendRawTransaction( ctx context.Context, tx *flow.TransactionBody, ) error
SendRawTransaction sends a raw transaction to the collection node
func (*Transactions) SendTransaction ¶
func (t *Transactions) SendTransaction(ctx context.Context, tx *flow.TransactionBody) error
SendTransaction forwards the transaction to the collection node