mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: rm pooledtx element type (#13286)
This commit is contained in:
@ -872,7 +872,7 @@ impl EthPoolTransaction for MockTransaction {
|
||||
sidecar: Arc<BlobTransactionSidecar>,
|
||||
) -> Option<RecoveredTx<Self::Pooled>> {
|
||||
let (tx, signer) = self.into_consensus().to_components();
|
||||
Self::Pooled::try_from_blob_transaction(tx, Arc::unwrap_or_clone(sidecar))
|
||||
tx.try_into_pooled_eip4844(Arc::unwrap_or_clone(sidecar))
|
||||
.map(|tx| tx.with_signer(signer))
|
||||
.ok()
|
||||
}
|
||||
@ -882,7 +882,7 @@ impl EthPoolTransaction for MockTransaction {
|
||||
sidecar: BlobTransactionSidecar,
|
||||
) -> Option<Self> {
|
||||
let (tx, signer) = tx.to_components();
|
||||
Self::Pooled::try_from_blob_transaction(tx, sidecar)
|
||||
tx.try_into_pooled_eip4844(sidecar)
|
||||
.map(|tx| tx.with_signer(signer))
|
||||
.ok()
|
||||
.map(Self::from_pooled)
|
||||
|
||||
@ -1238,9 +1238,11 @@ impl From<PooledTransactionsElementEcRecovered> for EthPooledTransaction {
|
||||
let encoded_length = tx.encode_2718_len();
|
||||
let (tx, signer) = tx.to_components();
|
||||
match tx {
|
||||
PooledTransactionsElement::BlobTransaction(tx) => {
|
||||
PooledTransactionsElement::Eip4844(tx) => {
|
||||
// include the blob sidecar
|
||||
let (tx, sig, hash) = tx.into_parts();
|
||||
let (tx, blob) = tx.into_parts();
|
||||
let tx = TransactionSigned::new(tx.into(), sig, hash);
|
||||
let tx = RecoveredTx::from_signed_transaction(tx, signer);
|
||||
let mut pooled = Self::new(tx, encoded_length);
|
||||
pooled.blob_sidecar = EthBlobTransactionSidecar::Present(blob);
|
||||
@ -1248,7 +1250,8 @@ impl From<PooledTransactionsElementEcRecovered> for EthPooledTransaction {
|
||||
}
|
||||
tx => {
|
||||
// no blob sidecar
|
||||
Self::new(tx.into_ecrecovered_transaction(signer), encoded_length)
|
||||
let tx = RecoveredTx::from_signed_transaction(tx.into(), signer);
|
||||
Self::new(tx, encoded_length)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1416,7 +1419,7 @@ impl EthPoolTransaction for EthPooledTransaction {
|
||||
sidecar: BlobTransactionSidecar,
|
||||
) -> Option<Self> {
|
||||
let (tx, signer) = tx.to_components();
|
||||
PooledTransactionsElement::try_from_blob_transaction(tx, sidecar)
|
||||
tx.try_into_pooled_eip4844(sidecar)
|
||||
.ok()
|
||||
.map(|tx| tx.with_signer(signer))
|
||||
.map(Self::from_pooled)
|
||||
|
||||
@ -850,7 +850,9 @@ mod tests {
|
||||
use alloy_eips::eip2718::Decodable2718;
|
||||
use alloy_primitives::{hex, U256};
|
||||
use reth_chainspec::MAINNET;
|
||||
use reth_primitives::PooledTransactionsElement;
|
||||
use reth_primitives::{
|
||||
transaction::SignedTransactionIntoRecoveredExt, PooledTransactionsElement,
|
||||
};
|
||||
use reth_provider::test_utils::{ExtendedAccount, MockEthProvider};
|
||||
|
||||
fn get_transaction() -> EthPooledTransaction {
|
||||
|
||||
Reference in New Issue
Block a user