Skip to content

Commit 20d3fa6

Browse files
feat: rename reth_primitives::RecoveredTx functions to match alloy::Recovered (#13663)
1 parent d10af50 commit 20d3fa6

File tree

27 files changed

+48
-49
lines changed

27 files changed

+48
-49
lines changed

bin/reth/src/commands/debug_cmd/build_block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
192192

193193
let pooled = transaction
194194
.clone()
195-
.into_signed()
195+
.into_tx()
196196
.try_into_pooled_eip4844(sidecar.clone())
197197
.expect("should not fail to convert blob tx if it is already eip4844");
198198
let encoded_length = pooled.encode_2718_len();

crates/blockchain-tree/src/blockchain_tree.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,8 +1592,7 @@ mod tests {
15921592
body: Vec<RecoveredTx<TransactionSigned>>,
15931593
num_of_signer_txs: u64|
15941594
-> SealedBlockWithSenders {
1595-
let signed_body =
1596-
body.clone().into_iter().map(|tx| tx.into_signed()).collect::<Vec<_>>();
1595+
let signed_body = body.clone().into_iter().map(|tx| tx.into_tx()).collect::<Vec<_>>();
15971596
let transactions_root = calculate_transaction_root(&signed_body);
15981597
let receipts = body
15991598
.iter()

crates/chain-state/src/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl<N: NodePrimitives> TestBlockBuilder<N> {
145145
gas_limit: ETHEREUM_BLOCK_GAS_LIMIT,
146146
base_fee_per_gas: Some(INITIAL_BASE_FEE),
147147
transactions_root: calculate_transaction_root(
148-
&transactions.clone().into_iter().map(|tx| tx.into_signed()).collect::<Vec<_>>(),
148+
&transactions.clone().into_iter().map(|tx| tx.into_tx()).collect::<Vec<_>>(),
149149
),
150150
receipts_root: calculate_receipt_root(&receipts),
151151
beneficiary: Address::random(),
@@ -171,7 +171,7 @@ impl<N: NodePrimitives> TestBlockBuilder<N> {
171171
let block = SealedBlock::new(
172172
SealedHeader::seal(header),
173173
BlockBody {
174-
transactions: transactions.into_iter().map(|tx| tx.into_signed()).collect(),
174+
transactions: transactions.into_iter().map(|tx| tx.into_tx()).collect(),
175175
ommers: Vec::new(),
176176
withdrawals: Some(vec![].into()),
177177
},

crates/ethereum/payload/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ where
285285
}
286286

287287
// Configure the environment for the tx.
288-
*evm.tx_mut() = evm_config.tx_env(tx.as_signed(), tx.signer());
288+
*evm.tx_mut() = evm_config.tx_env(tx.tx(), tx.signer());
289289

290290
let ResultAndState { result, state } = match evm.transact() {
291291
Ok(res) => res,
@@ -354,7 +354,7 @@ where
354354

355355
// append sender and transaction to the respective lists
356356
executed_senders.push(tx.signer());
357-
executed_txs.push(tx.into_signed());
357+
executed_txs.push(tx.into_tx());
358358
}
359359

360360
// check if we have a better block

crates/net/network/benches/broadcast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub fn broadcast_ingress_bench(c: &mut Criterion) {
6464
tx.sender(),
6565
ExtendedAccount::new(0, U256::from(100_000_000)),
6666
);
67-
txs.push(Arc::new(tx.transaction().clone().into_signed()));
67+
txs.push(Arc::new(tx.transaction().clone().into_tx()));
6868
peer1.send_transactions(peer0_id, txs);
6969
}
7070
}

crates/net/network/src/transactions/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ impl<T: SignedTransaction> PropagateTransaction<T> {
15381538
{
15391539
let size = tx.encoded_length();
15401540
let transaction = tx.transaction.clone_into_consensus();
1541-
let transaction = Arc::new(transaction.into_signed());
1541+
let transaction = Arc::new(transaction.into_tx());
15421542
Self { size, transaction }
15431543
}
15441544

crates/net/network/tests/it/txgossip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ async fn test_4844_tx_gossip_penalization() {
8080
}
8181

8282
let signed_txs: Vec<Arc<TransactionSigned>> =
83-
txs.iter().map(|tx| Arc::new(tx.transaction().clone().into_signed())).collect();
83+
txs.iter().map(|tx| Arc::new(tx.transaction().clone().into_tx())).collect();
8484

8585
let network_handle = peer0.network();
8686

crates/optimism/node/src/txpool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl TryFrom<RecoveredTx<OpTransactionSigned>> for OpPooledTransaction {
5858
type Error = TransactionConversionError;
5959

6060
fn try_from(value: RecoveredTx<OpTransactionSigned>) -> Result<Self, Self::Error> {
61-
let (tx, signer) = value.to_components();
61+
let (tx, signer) = value.into_parts();
6262
let pooled: RecoveredTx<op_alloy_consensus::OpPooledTransaction> =
6363
RecoveredTx::from_signed_transaction(tx.try_into()?, signer);
6464
Ok(pooled.into())
@@ -83,7 +83,7 @@ impl PoolTransaction for OpPooledTransaction {
8383
fn try_consensus_into_pooled(
8484
tx: RecoveredTx<Self::Consensus>,
8585
) -> Result<RecoveredTx<Self::Pooled>, Self::TryFromConsensusError> {
86-
let (tx, signer) = tx.to_components();
86+
let (tx, signer) = tx.into_parts();
8787
Ok(RecoveredTx::from_signed_transaction(tx.try_into()?, signer))
8888
}
8989

crates/optimism/payload/src/builder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ where
790790
))
791791
})?;
792792

793-
*evm.tx_mut() = self.evm_config.tx_env(sequencer_tx.as_signed(), sequencer_tx.signer());
793+
*evm.tx_mut() = self.evm_config.tx_env(sequencer_tx.tx(), sequencer_tx.signer());
794794

795795
let ResultAndState { result, state } = match evm.transact() {
796796
Ok(res) => res,
@@ -841,7 +841,7 @@ where
841841

842842
// append sender and transaction to the respective lists
843843
info.executed_senders.push(sequencer_tx.signer());
844-
info.executed_transactions.push(sequencer_tx.into_signed());
844+
info.executed_transactions.push(sequencer_tx.into_tx());
845845
}
846846

847847
Ok(info)
@@ -891,7 +891,7 @@ where
891891
}
892892

893893
// Configure the environment for the tx.
894-
*evm.tx_mut() = self.evm_config.tx_env(tx.as_signed(), tx.signer());
894+
*evm.tx_mut() = self.evm_config.tx_env(tx.tx(), tx.signer());
895895

896896
let ResultAndState { result, state } = match evm.transact() {
897897
Ok(res) => res,
@@ -954,7 +954,7 @@ where
954954

955955
// append sender and transaction to the respective lists
956956
info.executed_senders.push(tx.signer());
957-
info.executed_transactions.push(tx.into_signed());
957+
info.executed_transactions.push(tx.into_tx());
958958
}
959959

960960
Ok(None)

crates/optimism/rpc/src/eth/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ where
8989
) -> Result<Self::Transaction, Self::Error> {
9090
let from = tx.signer();
9191
let hash = *tx.tx_hash();
92-
let OpTransactionSigned { transaction, signature, .. } = tx.into_signed();
92+
let OpTransactionSigned { transaction, signature, .. } = tx.into_tx();
9393
let mut deposit_receipt_version = None;
9494
let mut deposit_nonce = None;
9595

0 commit comments

Comments
 (0)