chore(rpc): remove use of optimism feature from reth-rpc library (#9579)

This commit is contained in:
Emilia Hane
2024-07-17 15:29:14 +02:00
committed by GitHub
parent 0630621329
commit f55d43c25a
3 changed files with 0 additions and 35 deletions

View File

@@ -54,7 +54,6 @@ http-body.workspace = true
hyper.workspace = true
jsonwebtoken.workspace = true
serde_json.workspace = true
jsonrpsee-types = { workspace = true, optional = true }
# async
async-trait.workspace = true
@@ -91,6 +90,5 @@ optimism = [
"reth-provider/optimism",
"reth-rpc-eth-api/optimism",
"reth-revm/optimism",
"jsonrpsee-types",
"reth-rpc-eth-types/optimism",
]

View File

@@ -6,8 +6,6 @@ pub mod signer;
mod block;
mod call;
mod fees;
#[cfg(feature = "optimism")]
pub mod optimism;
mod pending_block;
mod receipt;
mod spec;

View File

@@ -1,31 +0,0 @@
//! Loads and formats OP transaction RPC response.
use jsonrpsee_types::error::ErrorObject;
use reth_rpc_eth_types::EthApiError;
use reth_rpc_server_types::result::internal_rpc_err;
use reth_rpc_types::ToRpcError;
/// Optimism specific errors, that extend [`EthApiError`].
#[derive(Debug, thiserror::Error)]
pub enum OptimismEthApiError {
/// Thrown when calculating L1 gas fee.
#[error("failed to calculate l1 gas fee")]
L1BlockFeeError,
/// Thrown when calculating L1 gas used
#[error("failed to calculate l1 gas used")]
L1BlockGasError,
}
impl ToRpcError for OptimismEthApiError {
fn to_rpc_error(&self) -> ErrorObject<'static> {
match self {
Self::L1BlockFeeError | Self::L1BlockGasError => internal_rpc_err(self.to_string()),
}
}
}
impl From<OptimismEthApiError> for EthApiError {
fn from(err: OptimismEthApiError) -> Self {
Self::other(err)
}
}