Skip to content

Commit

Permalink
chore: rm crate reth-rpc-types (paradigmxyz#11341)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg authored Oct 2, 2024
1 parent d5bdc1c commit 64fae4d
Show file tree
Hide file tree
Showing 18 changed files with 15 additions and 92 deletions.
14 changes: 0 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ members = [
"crates/rpc/rpc-server-types/",
"crates/rpc/rpc-testing-util/",
"crates/rpc/rpc-types-compat/",
"crates/rpc/rpc-types/",
"crates/rpc/rpc/",
"crates/stages/api/",
"crates/stages/stages/",
Expand Down Expand Up @@ -388,7 +387,6 @@ reth-rpc-eth-api = { path = "crates/rpc/rpc-eth-api" }
reth-rpc-eth-types = { path = "crates/rpc/rpc-eth-types", default-features = false }
reth-rpc-layer = { path = "crates/rpc/rpc-layer" }
reth-rpc-server-types = { path = "crates/rpc/rpc-server-types" }
reth-rpc-types = { path = "crates/rpc/rpc-types" }
reth-rpc-types-compat = { path = "crates/rpc/rpc-types-compat" }
reth-stages = { path = "crates/stages/stages" }
reth-stages-api = { path = "crates/stages/api" }
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -477,5 +477,4 @@ check-features:
--package reth-codecs \
--package reth-primitives-traits \
--package reth-primitives \
--package reth-rpc-types \
--feature-powerset
1 change: 0 additions & 1 deletion crates/engine/local/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ reth-ethereum-engine-primitives.workspace = true
reth-exex-test-utils.workspace = true
reth-payload-builder = { workspace = true, features = ["test-utils"] }
reth-provider = { workspace = true, features = ["test-utils"] }
reth-rpc-types.workspace = true
reth-tracing.workspace = true

[lints]
Expand Down
1 change: 0 additions & 1 deletion crates/node/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ reth-network = { workspace = true, features = ["serde"] }
reth-network-p2p.workspace = true
reth-rpc-eth-types.workspace = true
reth-rpc-server-types.workspace = true
reth-rpc-types.workspace = true
reth-rpc-types-compat.workspace = true
reth-rpc-api = { workspace = true, features = ["client"] }
reth-rpc-eth-api = { workspace = true, features = ["client"] }
Expand Down
5 changes: 0 additions & 5 deletions crates/node/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ pub mod primitives {

/// Re-export of `reth_rpc_*` crates.
pub mod rpc {
/// Re-exported from `reth_rpc_types`.
pub mod types {
pub use reth_rpc_types::*;
}

/// Re-exported from `reth_rpc_api`.
pub mod api {
pub use reth_rpc_api::*;
Expand Down
1 change: 0 additions & 1 deletion crates/optimism/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ reth-payload-builder.workspace = true
reth-auto-seal-consensus.workspace = true
reth-basic-payload-builder.workspace = true
reth-consensus.workspace = true
reth-rpc-types.workspace = true
reth-rpc-types-compat.workspace = true
reth-node-api.workspace = true
reth-node-builder.workspace = true
Expand Down
1 change: 0 additions & 1 deletion crates/rpc/rpc-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ reth-payload-builder = { workspace = true, features = ["test-utils"] }
reth-provider = { workspace = true, features = ["test-utils"] }
reth-rpc-api = { workspace = true, features = ["client"] }
reth-rpc-engine-api.workspace = true
reth-rpc-types.workspace = true
reth-tracing.workspace = true
reth-transaction-pool = { workspace = true, features = ["test-utils"] }
reth-tokio-util.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/rpc/rpc-eth-api/src/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub trait EthPubSubApi<T: RpcObject> {
#[subscription(
name = "subscribe" => "subscription",
unsubscribe = "unsubscribe",
item = reth_rpc_types::pubsub::SubscriptionResult
item = alloy_rpc_types::pubsub::SubscriptionResult
)]
async fn subscribe(
&self,
Expand Down
1 change: 0 additions & 1 deletion crates/rpc/rpc-eth-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ reth-primitives = { workspace = true, features = ["secp256k1"] }
reth-storage-api.workspace = true
reth-revm.workspace = true
reth-rpc-server-types.workspace = true
reth-rpc-types.workspace = true
reth-rpc-types-compat.workspace = true
reth-tasks.workspace = true
reth-transaction-pool.workspace = true
Expand Down
13 changes: 12 additions & 1 deletion crates/rpc/rpc-eth-types/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use reth_primitives::{revm_primitives::InvalidHeader, BlockId};
use reth_rpc_server_types::result::{
block_id_to_str, internal_rpc_err, invalid_params_rpc_err, rpc_err, rpc_error_with_code,
};
use reth_rpc_types::ToRpcError;
use reth_transaction_pool::error::{
Eip4844PoolTransactionError, Eip7702PoolTransactionError, InvalidPoolTransactionError,
PoolError, PoolErrorKind, PoolTransactionError,
Expand All @@ -19,6 +18,18 @@ use revm::primitives::{EVMError, ExecutionResult, HaltReason, InvalidTransaction
use revm_inspectors::tracing::MuxError;
use tracing::error;

/// A trait to convert an error to an RPC error.
pub trait ToRpcError: core::error::Error + Send + Sync + 'static {
/// Converts the error to a JSON-RPC error object.
fn to_rpc_error(&self) -> jsonrpsee_types::ErrorObject<'static>;
}

impl ToRpcError for jsonrpsee_types::ErrorObject<'static> {
fn to_rpc_error(&self) -> jsonrpsee_types::ErrorObject<'static> {
self.clone()
}
}

/// Result alias
pub type EthResult<T> = Result<T, EthApiError>;

Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/rpc-eth-types/src/simulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ use reth_primitives::{
};
use reth_revm::database::StateProviderDatabase;
use reth_rpc_server_types::result::rpc_err;
use reth_rpc_types::ToRpcError;
use reth_rpc_types_compat::{block::from_block, TransactionCompat};
use reth_storage_api::StateRootProvider;
use reth_trie::{HashedPostState, HashedStorage};
use revm::{db::CacheDB, Database};
use revm_primitives::{keccak256, Address, BlockEnv, Bytes, ExecutionResult, TxKind, B256, U256};

use crate::{
cache::db::StateProviderTraitObjWrapper, EthApiError, RevertError, RpcInvalidTransactionError,
cache::db::StateProviderTraitObjWrapper, error::ToRpcError, EthApiError, RevertError,
RpcInvalidTransactionError,
};

/// Errors which may occur during `eth_simulateV1` execution.
Expand Down
24 changes: 0 additions & 24 deletions crates/rpc/rpc-types/Cargo.toml

This file was deleted.

15 changes: 0 additions & 15 deletions crates/rpc/rpc-types/src/eth/error.rs

This file was deleted.

3 changes: 0 additions & 3 deletions crates/rpc/rpc-types/src/eth/mod.rs

This file was deleted.

17 changes: 0 additions & 17 deletions crates/rpc/rpc-types/src/lib.rs

This file was deleted.

1 change: 0 additions & 1 deletion examples/custom-rlpx-subprotocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ reth-network-api.workspace = true
reth-node-ethereum.workspace = true
reth-provider = { workspace = true, features = ["test-utils"] }
reth-primitives.workspace = true
reth-rpc-types.workspace = true
reth.workspace = true
tokio-stream.workspace = true
eyre.workspace = true
Expand Down
1 change: 0 additions & 1 deletion examples/db-access/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ reth-chainspec.workspace = true
reth-db.workspace = true
reth-primitives.workspace = true
reth-provider.workspace = true
reth-rpc-types.workspace = true
reth-node-ethereum.workspace = true
reth-node-types.workspace = true

Expand Down

0 comments on commit 64fae4d

Please sign in to comment.