chore(rpc): move impl of eth api server out of reth-rpc-eth-api (#9135)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Emilia Hane
2024-06-27 14:34:17 +02:00
committed by GitHub
parent 933a1dea39
commit 1b9f5871f5
92 changed files with 2326 additions and 1798 deletions

View File

@ -35,6 +35,8 @@ reth-beacon-consensus.workspace = true
reth-optimism-consensus.workspace = true
revm-primitives.workspace = true
reth-discv5.workspace = true
reth-rpc-eth-types.workspace = true
reth-rpc-eth-api.workspace = true
# async
async-trait.workspace = true
@ -44,11 +46,14 @@ tracing.workspace = true
# misc
clap.workspace = true
serde.workspace = true
serde_json.workspace = true
eyre.workspace = true
parking_lot.workspace = true
thiserror.workspace = true
# rpc
jsonrpsee.workspace = true
jsonrpsee-types.workspace = true
serde_json.workspace = true
[dev-dependencies]
reth.workspace = true
@ -71,4 +76,5 @@ optimism = [
"reth-beacon-consensus/optimism",
"reth-revm/optimism",
"reth-auto-seal-consensus/optimism",
"reth-rpc-eth-types/optimism"
]

View File

@ -1,14 +1,13 @@
//! Helpers for optimism specific RPC implementations.
use jsonrpsee::types::ErrorObject;
use reqwest::Client;
use reth_rpc::eth::{
error::{EthApiError, EthResult},
servers::RawTransactionForwarder,
};
use reth_rpc_types::ToRpcError;
use std::sync::{atomic::AtomicUsize, Arc};
use jsonrpsee_types::error::{ErrorObject, INTERNAL_ERROR_CODE};
use reqwest::Client;
use reth_rpc_eth_api::RawTransactionForwarder;
use reth_rpc_eth_types::error::{EthApiError, EthResult};
use reth_rpc_types::ToRpcError;
/// Error type when interacting with the Sequencer
#[derive(Debug, thiserror::Error)]
pub enum SequencerRpcError {
@ -22,11 +21,7 @@ pub enum SequencerRpcError {
impl ToRpcError for SequencerRpcError {
fn to_rpc_error(&self) -> ErrorObject<'static> {
ErrorObject::owned(
jsonrpsee::types::error::INTERNAL_ERROR_CODE,
self.to_string(),
None::<String>,
)
ErrorObject::owned(INTERNAL_ERROR_CODE, self.to_string(), None::<String>)
}
}