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

fix: debug_trace arguments #730

Merged
merged 8 commits into from
May 12, 2024
Merged
Changes from 7 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: 10 additions & 8 deletions crates/provider/src/ext/debug.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! This module extends the Ethereum JSON-RPC provider with the Debug namespace's RPC methods.
use crate::Provider;
use alloy_network::Network;
use alloy_primitives::{BlockNumber, TxHash, B256};
use alloy_primitives::{TxHash, B256};
use alloy_rpc_types::{BlockNumberOrTag, TransactionRequest};
use alloy_rpc_types_trace::geth::{
GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace,
GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult,
};
use alloy_transport::{Transport, TransportResult};

Expand Down Expand Up @@ -37,12 +37,14 @@ pub trait DebugApi<N, T>: Send + Sync {
///
/// # Note
///
/// https://github.com/ethereum/go-ethereum/blob/44a50c9f96386f44a8682d51cf7500044f6cbaea/eth/tracers/api.go#L448
///
/// Not all nodes support this call.
async fn debug_trace_block_by_hash(
&self,
block: B256,
trace_options: GethDebugTracingOptions,
) -> TransportResult<Vec<GethTrace>>;
) -> TransportResult<Vec<TraceResult>>;

/// Same as `debug_trace_block_by_hash` but block is specified by number.
///
Expand All @@ -53,9 +55,9 @@ pub trait DebugApi<N, T>: Send + Sync {
/// Not all nodes support this call.
async fn debug_trace_block_by_number(
&self,
block: BlockNumber,
block: BlockNumberOrTag,
trace_options: GethDebugTracingOptions,
) -> TransportResult<Vec<GethTrace>>;
) -> TransportResult<Vec<TraceResult>>;

/// Executes the given transaction without publishing it like `eth_call` and returns the trace
/// of the execution.
Expand Down Expand Up @@ -111,15 +113,15 @@ where
&self,
block: B256,
trace_options: GethDebugTracingOptions,
) -> TransportResult<Vec<GethTrace>> {
) -> TransportResult<Vec<TraceResult>> {
self.client().request("debug_traceBlockByHash", (block, trace_options)).await
}

async fn debug_trace_block_by_number(
&self,
block: BlockNumber,
block: BlockNumberOrTag,
trace_options: GethDebugTracingOptions,
) -> TransportResult<Vec<GethTrace>> {
) -> TransportResult<Vec<TraceResult>> {
self.client().request("debug_traceBlockByNumber", (block, trace_options)).await
}

Expand Down
Loading