mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-28 08:37:59 -05:00
chore(rpc): remove use of optimism feature from reth-rpc library (#9579)
This commit is contained in:
@@ -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",
|
||||
]
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user