forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature gate
jsonrpsee
related crates and check features powerset f…
…or `reth-rpc-types` (paradigmxyz#10141) Co-authored-by: Matthias Seitz <[email protected]>
- Loading branch information
1 parent
f8104cc
commit 2ab17a4
Showing
5 changed files
with
22 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
//! Implementation specific Errors for the `eth_` namespace. | ||
use jsonrpsee_types::ErrorObject; | ||
|
||
/// A trait to convert an error to an RPC error. | ||
#[cfg(feature = "jsonrpsee-types")] | ||
pub trait ToRpcError: std::error::Error + Send + Sync + 'static { | ||
/// Converts the error to a JSON-RPC error object. | ||
fn to_rpc_error(&self) -> ErrorObject<'static>; | ||
fn to_rpc_error(&self) -> jsonrpsee_types::ErrorObject<'static>; | ||
} | ||
|
||
impl ToRpcError for ErrorObject<'static> { | ||
fn to_rpc_error(&self) -> ErrorObject<'static> { | ||
#[cfg(feature = "jsonrpsee-types")] | ||
impl ToRpcError for jsonrpsee_types::ErrorObject<'static> { | ||
fn to_rpc_error(&self) -> jsonrpsee_types::ErrorObject<'static> { | ||
self.clone() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters