refactor: rename TransactionSignedEcRecovered to RecoveredTx (#13074)

This commit is contained in:
Arsenii Kulikov
2024-12-03 03:36:09 +04:00
committed by GitHub
parent 9831953781
commit 9ed9fa241d
28 changed files with 170 additions and 223 deletions

View File

@ -1,5 +1,5 @@
use alloy_primitives::Address;
use reth_primitives::TransactionSignedEcRecovered;
use reth_primitives::RecoveredTx;
/// Iterator that returns transactions for the block building process in the order they should be
/// included in the block.
@ -12,7 +12,7 @@ pub trait PayloadTransactions {
&mut self,
// In the future, `ctx` can include access to state for block building purposes.
ctx: (),
) -> Option<TransactionSignedEcRecovered>;
) -> Option<RecoveredTx>;
/// Exclude descendants of the transaction with given sender and nonce from the iterator,
/// because this transaction won't be included in the block.

View File

@ -1,7 +1,7 @@
use crate::PayloadTransactions;
use alloy_consensus::Transaction;
use alloy_primitives::Address;
use reth_primitives::TransactionSignedEcRecovered;
use reth_primitives::RecoveredTx;
/// An implementation of [`crate::traits::PayloadTransactions`] that yields
/// a pre-defined set of transactions.
@ -26,8 +26,8 @@ impl<T> PayloadTransactionsFixed<T> {
}
}
impl PayloadTransactions for PayloadTransactionsFixed<TransactionSignedEcRecovered> {
fn next(&mut self, _ctx: ()) -> Option<TransactionSignedEcRecovered> {
impl PayloadTransactions for PayloadTransactionsFixed<RecoveredTx> {
fn next(&mut self, _ctx: ()) -> Option<RecoveredTx> {
(self.index < self.transactions.len()).then(|| {
let tx = self.transactions[self.index].clone();
self.index += 1;
@ -92,7 +92,7 @@ where
B: PayloadTransactions,
A: PayloadTransactions,
{
fn next(&mut self, ctx: ()) -> Option<TransactionSignedEcRecovered> {
fn next(&mut self, ctx: ()) -> Option<RecoveredTx> {
while let Some(tx) = self.before.next(ctx) {
if let Some(before_max_gas) = self.before_max_gas {
if self.before_gas + tx.transaction.gas_limit() <= before_max_gas {