1use alloy_rpc_types_trace::geth::{
2 GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace,
3 TraceResult,
4};
5use cfx_rpc_eth_types::{BlockId, BlockProperties, TransactionRequest};
6use cfx_types::H256;
7use jsonrpsee::{core::RpcResult, proc_macros::rpc};
8
9#[rpc(server, namespace = "debug")]
10pub trait DebugApi {
11 #[method(name = "dbGet")]
12 async fn db_get(&self, key: String) -> RpcResult<Option<String>>;
13
14 #[method(name = "traceTransaction")]
20 async fn debug_trace_transaction(
21 &self, tx_hash: H256, opts: Option<GethDebugTracingOptions>,
22 ) -> RpcResult<GethTrace>;
23
24 #[method(name = "traceBlockByHash")]
25 async fn debug_trace_block_by_hash(
26 &self, block: H256, opts: Option<GethDebugTracingOptions>,
27 ) -> RpcResult<Vec<TraceResult>>;
28
29 #[method(name = "traceBlockByNumber")]
30 async fn debug_trace_block_by_number(
31 &self, block: BlockId, opts: Option<GethDebugTracingOptions>,
32 ) -> RpcResult<Vec<TraceResult>>;
33
34 #[method(name = "traceCall")]
35 async fn debug_trace_call(
36 &self, request: TransactionRequest, block_number: Option<BlockId>,
37 opts: Option<GethDebugTracingCallOptions>,
38 ) -> RpcResult<GethTrace>;
39
40 #[method(name = "blockProperties")]
43 async fn debug_block_properties(
44 &self, block_number: BlockId,
45 ) -> RpcResult<Option<Vec<BlockProperties>>>;
46}