Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(op): remove redundant trait NetworkEthApi #8411

Merged
merged 1 commit into from
May 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions crates/rpc/rpc-api/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,10 @@ use reth_rpc_types::{
TransactionRequest, Work,
};

pub trait NetworkEthApi {
type Block;
type TxReceipt;

async fn block_by_hash(&self, eth: &EthApiInner, hash: B256, full: bool) -> RpcResult<Option<Self::Block>>;

async fn build_transaction_receipt(
&self,
tx: TransactionSigned,
meta: TransactionMeta,
receipt: Receipt,
) -> EthResult<Self::TxReceipt>;
}

/// Eth rpc interface: <https://ethereum.github.io/execution-apis/api-documentation/>
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "eth"))]
#[cfg_attr(feature = "client", rpc(server, client, namespace = "eth"))]
pub trait EthApi<N: NetworkEthApi> {
pub trait EthApi {
/// Returns the protocol version encoded as a string.
#[method(name = "protocolVersion")]
async fn protocol_version(&self) -> RpcResult<U64>;
Expand All @@ -51,7 +37,7 @@ pub trait EthApi<N: NetworkEthApi> {

/// Returns information about a block by hash.
#[method(name = "getBlockByHash")]
async fn block_by_hash(&self, hash: B256, full: bool) -> RpcResult<Option<N::Block>>;
async fn block_by_hash(&self, hash: B256, full: bool) -> RpcResult<Option<RichBlock>>;

/// Returns information about a block by number.
#[method(name = "getBlockByNumber")]
Expand Down
Loading