Skip to content

feat(rpc): stub tracing methods #49

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
22 changes: 22 additions & 0 deletions crates/rpc/src/debug/endpoints.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use crate::{Pnt, RpcCtx};
use reth_node_api::FullNodeComponents;

pub(super) async fn trace_transaction<Host, Signet>(
_ctx: RpcCtx<Host, Signet>,
) -> Result<(), String>
where
Host: FullNodeComponents,
Signet: Pnt,
{
Ok(())
}

pub(super) async fn trace_block_by_number<Host, Signet>(
_ctx: RpcCtx<Host, Signet>,
) -> Result<(), String>
where
Host: FullNodeComponents,
Signet: Pnt,
{
Ok(())
}
16 changes: 16 additions & 0 deletions crates/rpc/src/debug/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
mod endpoints;
use endpoints::*;
use reth_node_api::FullNodeComponents;

use crate::{Pnt, RpcCtx};

/// Instantiate the debug router.
pub fn debug<Host, Signet>() -> ajj::Router<RpcCtx<Host, Signet>>
where
Host: FullNodeComponents,
Signet: Pnt,
{
ajj::Router::new()
.route("traceTransaction", trace_transaction)
.route("traceBlockByNumber", trace_block_by_number)
}
12 changes: 11 additions & 1 deletion crates/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ pub use eth::{eth, CallErrorData, EthError};
mod signet;
pub use signet::{error::SignetError, signet};

mod debug;
pub use debug::debug;

mod trace;
pub use trace::trace;

mod interest;

pub mod receipts;
Expand All @@ -80,5 +86,9 @@ where
Host: FullNodeComponents,
Signet: Pnt,
{
ajj::Router::new().nest("eth", eth::<Host, Signet>()).nest("signet", signet::<Host, Signet>())
ajj::Router::new()
.nest("eth", eth::<Host, Signet>())
.nest("signet", signet::<Host, Signet>())
.nest("debug", debug::<Host, Signet>())
.nest("trace", trace::<Host, Signet>())
}
20 changes: 20 additions & 0 deletions crates/rpc/src/trace/endpoints.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use crate::{Pnt, RpcCtx};
use reth_node_api::FullNodeComponents;

pub(super) async fn trace_block<Host, Signet>(_ctx: RpcCtx<Host, Signet>) -> Result<(), String>
where
Host: FullNodeComponents,
Signet: Pnt,
{
Ok(())
}

pub(super) async fn trace_replay_block_transactions<Host, Signet>(
_ctx: RpcCtx<Host, Signet>,
) -> Result<(), String>
where
Host: FullNodeComponents,
Signet: Pnt,
{
Ok(())
}
16 changes: 16 additions & 0 deletions crates/rpc/src/trace/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
mod endpoints;
use endpoints::*;

use crate::{ctx::RpcCtx, Pnt};
use reth_node_api::FullNodeComponents;

/// Instantiate the `trace` API router.
pub fn trace<Host, Signet>() -> ajj::Router<RpcCtx<Host, Signet>>
where
Host: FullNodeComponents,
Signet: Pnt,
{
ajj::Router::new()
.route("block", trace_block)
.route("replayBlockTransactions", trace_replay_block_transactions)
}