Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: port reth pooled tx type #1767

Merged
merged 4 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions crates/consensus/src/transaction/eip4844.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,15 @@ impl TxEip4844Variant {
Self::TxEip4844WithSidecar(tx) => tx.size(),
}
}

/// Tries to unwrap the [`TxEip4844WithSidecar`] returns the transaction as error if it is not a
/// [`TxEip4844WithSidecar`]
pub fn try_into_4844_with_sidecar(self) -> Result<TxEip4844WithSidecar, Self> {
match self {
Self::TxEip4844WithSidecar(tx) => Ok(tx),
_ => Err(self),
}
}
}

impl Transaction for TxEip4844Variant {
Expand Down
2 changes: 2 additions & 0 deletions crates/consensus/src/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pub use eip7702::TxEip7702;

/// [EIP-4844] constants, helpers, and types.
pub mod eip4844;
pub mod pooled;
pub use pooled::PooledTransaction;

use alloy_eips::eip4844::DATA_GAS_PER_BLOB;
pub use alloy_eips::eip4844::{
Expand Down
Loading
Loading