diff --git a/Cargo.lock b/Cargo.lock index 4508b146d..3eeca2328 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8126,6 +8126,7 @@ dependencies = [ name = "reth-primitives" version = "1.0.5" dependencies = [ + "alloy-consensus", "alloy-eips", "alloy-genesis", "alloy-primitives", diff --git a/crates/primitives/Cargo.toml b/crates/primitives/Cargo.toml index 32ace7c45..5d8454d59 100644 --- a/crates/primitives/Cargo.toml +++ b/crates/primitives/Cargo.toml @@ -27,6 +27,7 @@ alloy-rlp = { workspace = true, features = ["arrayvec"] } alloy-rpc-types = { workspace = true, optional = true } alloy-genesis.workspace = true alloy-eips = { workspace = true, features = ["serde"] } +alloy-consensus.workspace = true # crypto secp256k1 = { workspace = true, features = [ diff --git a/crates/primitives/src/transaction/tx_type.rs b/crates/primitives/src/transaction/tx_type.rs index 459f481f9..e73a904d8 100644 --- a/crates/primitives/src/transaction/tx_type.rs +++ b/crates/primitives/src/transaction/tx_type.rs @@ -220,6 +220,18 @@ impl Decodable for TxType { } } +impl From for TxType { + fn from(value: alloy_consensus::TxType) -> Self { + match value { + alloy_consensus::TxType::Legacy => Self::Legacy, + alloy_consensus::TxType::Eip2930 => Self::Eip2930, + alloy_consensus::TxType::Eip1559 => Self::Eip1559, + alloy_consensus::TxType::Eip4844 => Self::Eip4844, + //alloy_consensus::TxType::Eip7702 => Self::Eip7702, + } + } +} + #[cfg(test)] mod tests { use crate::hex;