diff --git a/Cargo.lock b/Cargo.lock index cf72d69fdb..c9a58c5d3d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6732,7 +6732,6 @@ dependencies = [ name = "reth-rpc-api-testing-util" version = "0.1.0-alpha.19" dependencies = [ - "async-trait", "futures", "jsonrpsee", "reth-primitives", diff --git a/crates/rpc/rpc-testing-util/Cargo.toml b/crates/rpc/rpc-testing-util/Cargo.toml index d2c69c384e..b14451969c 100644 --- a/crates/rpc/rpc-testing-util/Cargo.toml +++ b/crates/rpc/rpc-testing-util/Cargo.toml @@ -18,7 +18,6 @@ reth-rpc-types.workspace = true reth-rpc-api = { workspace = true, features = ["client"] } # async -async-trait.workspace = true futures.workspace = true # misc diff --git a/crates/rpc/rpc-testing-util/src/debug.rs b/crates/rpc/rpc-testing-util/src/debug.rs index a013965eb5..721ad264dc 100644 --- a/crates/rpc/rpc-testing-util/src/debug.rs +++ b/crates/rpc/rpc-testing-util/src/debug.rs @@ -12,9 +12,11 @@ use reth_rpc_types::{ TransactionRequest, }; use std::{ + future::Future, pin::Pin, task::{Context, Poll}, }; + const NOOP_TRACER: &str = include_str!("../assets/noop-tracer.js"); const JS_TRACER_TEMPLATE: &str = include_str!("../assets/tracer-template.js"); @@ -26,24 +28,23 @@ pub type DebugTraceBlockResult = Result<(Vec>, BlockId), (RpcError, BlockId)>; /// An extension trait for the Trace API. -#[async_trait::async_trait] pub trait DebugApiExt { /// The provider type that is used to make the requests. type Provider; /// Same as [DebugApiClient::debug_trace_transaction] but returns the result as json. - async fn debug_trace_transaction_json( + fn debug_trace_transaction_json( &self, hash: B256, opts: GethDebugTracingOptions, - ) -> Result; + ) -> impl Future> + Send; /// Trace all transactions in a block individually with the given tracing opts. - async fn debug_trace_transactions_in_block( + fn debug_trace_transactions_in_block( &self, block: B, opts: GethDebugTracingOptions, - ) -> Result, jsonrpsee::core::Error> + ) -> impl Future, jsonrpsee::core::Error>> + Send where B: Into + Send; @@ -59,21 +60,20 @@ pub trait DebugApiExt { B: Into + Send; /// method for debug_traceCall - async fn debug_trace_call_json( + fn debug_trace_call_json( &self, request: TransactionRequest, opts: GethDebugTracingOptions, - ) -> Result; + ) -> impl Future> + Send; /// method for debug_traceCall using raw JSON strings for the request and options. - async fn debug_trace_call_raw_json( + fn debug_trace_call_raw_json( &self, request_json: String, opts_json: String, - ) -> Result; + ) -> impl Future> + Send; } -#[async_trait::async_trait] impl DebugApiExt for T where T: EthApiClient, diff --git a/crates/rpc/rpc-testing-util/src/trace.rs b/crates/rpc/rpc-testing-util/src/trace.rs index b2e6ce9c38..2d3cff72a8 100644 --- a/crates/rpc/rpc-testing-util/src/trace.rs +++ b/crates/rpc/rpc-testing-util/src/trace.rs @@ -46,7 +46,6 @@ pub type TraceFilterResult = pub type TraceCallResult = Result; /// An extension trait for the Trace API. -#[async_trait::async_trait] pub trait TraceApiExt { /// The provider type that is used to make the requests. type Provider; @@ -236,7 +235,6 @@ impl<'a> std::fmt::Debug for ReplayTransactionStream<'a> { } } -#[async_trait::async_trait] impl TraceApiExt for T { type Provider = T;