cfx_rpc_eth_api/
trace.rs

1use cfx_rpc_eth_types::{
2    BlockId, Index, LocalizedSetAuthTrace, LocalizedTrace, TraceFilter,
3};
4use cfx_types::H256;
5use jsonrpsee::{core::RpcResult, proc_macros::rpc};
6
7#[rpc(server, namespace = "trace")]
8pub trait TraceApi {
9    /// Returns all traces produced at the given block.
10    #[method(name = "block")]
11    async fn block_traces(
12        &self, block_number: BlockId,
13    ) -> RpcResult<Option<Vec<LocalizedTrace>>>;
14
15    /// Returns all set auth traces produced at the given block.
16    #[method(name = "blockSetAuth")]
17    async fn block_set_auth_traces(
18        &self, block_number: BlockId,
19    ) -> RpcResult<Option<Vec<LocalizedSetAuthTrace>>>;
20
21    /// Returns all traces matching the provided filter.
22    #[method(name = "filter")]
23    async fn filter_traces(
24        &self, filter: TraceFilter,
25    ) -> RpcResult<Vec<LocalizedTrace>>;
26
27    #[method(name = "get")]
28    async fn trace_get(
29        &self, hash: H256, indices: Vec<Index>,
30    ) -> RpcResult<Option<LocalizedTrace>>;
31
32    /// Returns all traces produced at the given transaction.
33    #[method(name = "transaction")]
34    async fn transaction_traces(
35        &self, tx_hash: H256,
36    ) -> RpcResult<Option<Vec<LocalizedTrace>>>;
37}