diff --git a/Cargo.lock b/Cargo.lock index c84807991..6e4e62abe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7599,7 +7599,7 @@ dependencies = [ "alloy-network", "alloy-primitives", "alloy-rlp", - "alloy-rpc-types", + "alloy-rpc-types-eth", "alloy-serde", "arbitrary", "bincode", @@ -9238,13 +9238,11 @@ version = "1.1.5" dependencies = [ "alloy-consensus", "alloy-primitives", - "alloy-rpc-types-engine", "alloy-rpc-types-eth", "jsonrpsee-types", "reth-primitives", "reth-primitives-traits", "serde", - "serde_json", ] [[package]] diff --git a/crates/ethereum/primitives/Cargo.toml b/crates/ethereum/primitives/Cargo.toml index 81b15d0f9..9cf44822e 100644 --- a/crates/ethereum/primitives/Cargo.toml +++ b/crates/ethereum/primitives/Cargo.toml @@ -24,7 +24,7 @@ alloy-network = { workspace = true, optional = true } alloy-consensus = { workspace = true, features = ["serde"] } alloy-serde = { workspace = true, optional = true } alloy-rlp.workspace = true -alloy-rpc-types = { workspace = true, optional = true } +alloy-rpc-types-eth = { workspace = true, optional = true } revm-primitives.workspace = true # misc @@ -54,7 +54,7 @@ test-utils = [ "reth-codecs?/test-utils", "reth-primitives-traits/test-utils", ] -alloy-compat = ["dep:alloy-network", "dep:alloy-serde", "dep:alloy-rpc-types"] +alloy-compat = ["dep:alloy-network", "dep:alloy-serde", "dep:alloy-rpc-types-eth"] std = [ "alloy-consensus/std", "alloy-primitives/std", @@ -67,6 +67,7 @@ std = [ "secp256k1?/std", "revm-primitives/std", "alloy-serde?/std", + "alloy-rpc-types-eth?/std", ] reth-codec = [ "std", @@ -84,8 +85,8 @@ arbitrary = [ "reth-primitives-traits/arbitrary", "alloy-eips/arbitrary", "revm-primitives/arbitrary", - "alloy-rpc-types?/arbitrary", "alloy-serde?/arbitrary", + "alloy-rpc-types-eth?/arbitrary", ] serde-bincode-compat = [ "alloy-consensus/serde-bincode-compat", diff --git a/crates/ethereum/primitives/src/alloy_compat.rs b/crates/ethereum/primitives/src/alloy_compat.rs index 0abb52164..3be52b974 100644 --- a/crates/ethereum/primitives/src/alloy_compat.rs +++ b/crates/ethereum/primitives/src/alloy_compat.rs @@ -4,13 +4,14 @@ use crate::{Transaction, TransactionSigned}; use alloc::string::ToString; use alloy_consensus::TxEnvelope; use alloy_network::{AnyRpcTransaction, AnyTxEnvelope}; +use alloy_rpc_types_eth::Transaction as AlloyRpcTransaction; use alloy_serde::WithOtherFields; impl TryFrom for TransactionSigned { - type Error = alloy_rpc_types::ConversionError; + type Error = alloy_rpc_types_eth::ConversionError; fn try_from(tx: AnyRpcTransaction) -> Result { - use alloy_rpc_types::ConversionError; + use alloy_rpc_types_eth::ConversionError; let WithOtherFields { inner: tx, other: _ } = tx; @@ -41,3 +42,12 @@ impl TryFrom for TransactionSigned { Ok(Self::new(transaction, signature, hash)) } } + +impl From> for TransactionSigned +where + Self: From, +{ + fn from(value: AlloyRpcTransaction) -> Self { + value.inner.into() + } +} diff --git a/crates/ethereum/primitives/src/lib.rs b/crates/ethereum/primitives/src/lib.rs index 21a9efb98..4a7b02c60 100644 --- a/crates/ethereum/primitives/src/lib.rs +++ b/crates/ethereum/primitives/src/lib.rs @@ -6,7 +6,6 @@ issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/" )] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] -#![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(not(feature = "std"), no_std)] extern crate alloc; diff --git a/crates/rpc/rpc-types-compat/Cargo.toml b/crates/rpc/rpc-types-compat/Cargo.toml index 5a8456f3c..f3b732e3e 100644 --- a/crates/rpc/rpc-types-compat/Cargo.toml +++ b/crates/rpc/rpc-types-compat/Cargo.toml @@ -24,7 +24,3 @@ alloy-consensus.workspace = true # io serde.workspace = true jsonrpsee-types.workspace = true - -[dev-dependencies] -alloy-rpc-types-engine = { workspace = true, features = ["serde"] } -serde_json.workspace = true