diff --git a/engine/access/rpc/backend/backend_stream_transactions.go b/engine/access/rpc/backend/backend_stream_transactions.go index b8908365f32..a82b365240e 100644 --- a/engine/access/rpc/backend/backend_stream_transactions.go +++ b/engine/access/rpc/backend/backend_stream_transactions.go @@ -126,7 +126,7 @@ func (b *backendSubscribeTransactions) getTransactionStatusResponse(txInfo *Tran // When a block with the transaction is available, it is possible to receive a new transaction status while // searching for the transaction result. Otherwise, it remains unchanged. So, if the old and new transaction // statuses are the same, the current transaction status should be retrieved. - txInfo.Status, err = b.txLocalDataProvider.DeriveTransactionStatus(txInfo.BlockID, txInfo.blockWithTx.Height, txInfo.txExecuted) + txInfo.Status, err = b.txLocalDataProvider.DeriveTransactionStatus(txInfo.blockWithTx.Height, txInfo.txExecuted) } if err != nil { if !errors.Is(err, state.ErrUnknownSnapshotReference) { diff --git a/engine/access/rpc/backend/backend_transactions.go b/engine/access/rpc/backend/backend_transactions.go index 831a5efa404..10a3b31eb84 100644 --- a/engine/access/rpc/backend/backend_transactions.go +++ b/engine/access/rpc/backend/backend_transactions.go @@ -313,7 +313,7 @@ func (b *backendTransactions) GetTransactionResult( if block == nil { txStatus, err = b.DeriveUnknownTransactionStatus(tx.ReferenceBlockID) } else { - txStatus, err = b.DeriveTransactionStatus(blockID, blockHeight, false) + txStatus, err = b.DeriveTransactionStatus(blockHeight, false) } if err != nil { @@ -439,7 +439,7 @@ func (b *backendTransactions) getTransactionResultsByBlockIDFromExecutionNode( txResult := resp.TransactionResults[i] // tx body is irrelevant to status if it's in an executed block - txStatus, err := b.DeriveTransactionStatus(blockID, block.Header.Height, true) + txStatus, err := b.DeriveTransactionStatus(block.Header.Height, true) if err != nil { if !errors.Is(err, state.ErrUnknownSnapshotReference) { irrecoverable.Throw(ctx, err) @@ -488,7 +488,7 @@ func (b *backendTransactions) getTransactionResultsByBlockIDFromExecutionNode( } systemTxResult := resp.TransactionResults[len(resp.TransactionResults)-1] - systemTxStatus, err := b.DeriveTransactionStatus(blockID, block.Header.Height, true) + systemTxStatus, err := b.DeriveTransactionStatus(block.Header.Height, true) if err != nil { if !errors.Is(err, state.ErrUnknownSnapshotReference) { irrecoverable.Throw(ctx, err) @@ -573,7 +573,7 @@ func (b *backendTransactions) getTransactionResultByIndexFromExecutionNode( } // tx body is irrelevant to status if it's in an executed block - txStatus, err := b.DeriveTransactionStatus(blockID, block.Header.Height, true) + txStatus, err := b.DeriveTransactionStatus(block.Header.Height, true) if err != nil { if !errors.Is(err, state.ErrUnknownSnapshotReference) { irrecoverable.Throw(ctx, err) @@ -626,7 +626,7 @@ func (b *backendTransactions) GetSystemTransactionResult(ctx context.Context, bl } systemTxResult := resp.TransactionResults[len(resp.TransactionResults)-1] - systemTxStatus, err := b.DeriveTransactionStatus(blockID, block.Header.Height, true) + systemTxStatus, err := b.DeriveTransactionStatus(block.Header.Height, true) if err != nil { return nil, rpc.ConvertStorageError(err) } @@ -793,7 +793,7 @@ func (b *backendTransactions) getTransactionResultFromExecutionNode( } // tx body is irrelevant to status if it's in an executed block - txStatus, err := b.DeriveTransactionStatus(blockID, block.Header.Height, true) + txStatus, err := b.DeriveTransactionStatus(block.Header.Height, true) if err != nil { if !errors.Is(err, state.ErrUnknownSnapshotReference) { irrecoverable.Throw(ctx, err) diff --git a/engine/access/rpc/backend/retry.go b/engine/access/rpc/backend/retry.go index 27697319a14..d5389e29b19 100644 --- a/engine/access/rpc/backend/retry.go +++ b/engine/access/rpc/backend/retry.go @@ -125,7 +125,7 @@ func (r *Retry) retryTxsAtHeight(heightToRetry uint64) error { if block == nil { status, err = r.backend.DeriveUnknownTransactionStatus(tx.ReferenceBlockID) } else { - status, err = r.backend.DeriveTransactionStatus(block.ID(), block.Header.Height, false) + status, err = r.backend.DeriveTransactionStatus(block.Header.Height, false) } if err != nil { diff --git a/engine/access/rpc/backend/transactions_local_data_provider.go b/engine/access/rpc/backend/transactions_local_data_provider.go index dcde825a2f0..51838d34d9b 100644 --- a/engine/access/rpc/backend/transactions_local_data_provider.go +++ b/engine/access/rpc/backend/transactions_local_data_provider.go @@ -94,7 +94,7 @@ func (t *TransactionsLocalDataProvider) GetTransactionResultFromStorage( txStatusCode = 1 // statusCode of 1 indicates an error and 0 indicates no error, the same as on EN } - txStatus, err := t.DeriveTransactionStatus(blockID, block.Header.Height, true) + txStatus, err := t.DeriveTransactionStatus(block.Header.Height, true) if err != nil { if !errors.Is(err, state.ErrUnknownSnapshotReference) { irrecoverable.Throw(ctx, err) @@ -178,7 +178,7 @@ func (t *TransactionsLocalDataProvider) GetTransactionResultsByBlockIDFromStorag txStatusCode = 1 } - txStatus, err := t.DeriveTransactionStatus(blockID, block.Header.Height, true) + txStatus, err := t.DeriveTransactionStatus(block.Header.Height, true) if err != nil { if !errors.Is(err, state.ErrUnknownSnapshotReference) { irrecoverable.Throw(ctx, err) @@ -255,7 +255,7 @@ func (t *TransactionsLocalDataProvider) GetTransactionResultByIndexFromStorage( txStatusCode = 1 // statusCode of 1 indicates an error and 0 indicates no error, the same as on EN } - txStatus, err := t.DeriveTransactionStatus(blockID, block.Header.Height, true) + txStatus, err := t.DeriveTransactionStatus(block.Header.Height, true) if err != nil { if !errors.Is(err, state.ErrUnknownSnapshotReference) { irrecoverable.Throw(ctx, err) @@ -338,9 +338,9 @@ func (t *TransactionsLocalDataProvider) DeriveUnknownTransactionStatus(refBlockI return flow.TransactionStatusPending, nil } -// DeriveTransactionStatus is used to determine the status of a transaction based on the provided block ID, block height, and execution status. +// DeriveTransactionStatus is used to determine the status of a transaction based on the provided block height, and execution status. // No errors expected during normal operations. -func (t *TransactionsLocalDataProvider) DeriveTransactionStatus(blockID flow.Identifier, blockHeight uint64, executed bool) (flow.TransactionStatus, error) { +func (t *TransactionsLocalDataProvider) DeriveTransactionStatus(blockHeight uint64, executed bool) (flow.TransactionStatus, error) { if !executed { // If we've gotten here, but the block has not yet been executed, report it as only been finalized return flow.TransactionStatusFinalized, nil