add DebugApi struct, functions to be implemented (#1000)

This commit is contained in:
TurboFish
2023-01-24 02:19:28 -08:00
committed by GitHub
parent 6f047a5de0
commit 1e94131cf8
2 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
use async_trait::async_trait;
use jsonrpsee::core::RpcResult as Result;
use reth_primitives::{rpc::BlockId, Bytes, H256};
use reth_rpc_api::DebugApiServer;
use reth_rpc_types::RichBlock;
/// `debug` API implementation.
///
/// This type provides the functionality for handling `debug` related requests.
pub struct DebugApi {
// TODO: add proper handler when implementing functions
}
#[async_trait]
impl DebugApiServer for DebugApi {
async fn raw_header(&self, _block_id: BlockId) -> Result<Bytes> {
todo!()
}
async fn raw_block(&self, _block_id: BlockId) -> Result<Bytes> {
todo!()
}
async fn raw_transaction(&self, _hash: H256) -> Result<Bytes> {
todo!()
}
async fn raw_receipts(&self, _block_id: BlockId) -> Result<Vec<Bytes>> {
todo!()
}
async fn bad_blocks(&self) -> Result<Vec<RichBlock>> {
todo!()
}
}
impl std::fmt::Debug for DebugApi {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("DebugApi").finish_non_exhaustive()
}
}

View File

@@ -12,12 +12,14 @@
//! Provides the implementation of all RPC interfaces.
mod admin;
mod debug;
mod engine;
mod eth;
mod net;
mod web3;
pub use admin::AdminApi;
pub use debug::DebugApi;
pub use engine::EngineApi;
pub use eth::{EthApi, EthApiSpec, EthPubSub};
pub use net::NetApi;