From 69936ad9dc03f7c81d8838df1ef7164f0774d4bd Mon Sep 17 00:00:00 2001 From: Rodrigo Quelhas Date: Mon, 6 May 2024 15:28:06 +0100 Subject: [PATCH 1/2] feat: add trace_call to DebugRuntimeApi trait --- .../shared/primitives/rpc/debug/Cargo.toml | 1 + .../shared/primitives/rpc/debug/src/lib.rs | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/tracing/shared/primitives/rpc/debug/Cargo.toml b/tracing/shared/primitives/rpc/debug/Cargo.toml index a81a24e..1dd8478 100644 --- a/tracing/shared/primitives/rpc/debug/Cargo.toml +++ b/tracing/shared/primitives/rpc/debug/Cargo.toml @@ -28,6 +28,7 @@ default = [ "std" ] before_700 = [] _700_to_1200 = [] runtime-2900 = [] +runtime-3000 = [] std = [ "parity-scale-codec/std", diff --git a/tracing/shared/primitives/rpc/debug/src/lib.rs b/tracing/shared/primitives/rpc/debug/src/lib.rs index 8930214..bf37dc9 100644 --- a/tracing/shared/primitives/rpc/debug/src/lib.rs +++ b/tracing/shared/primitives/rpc/debug/src/lib.rs @@ -28,6 +28,36 @@ use ethereum::TransactionV2 as Transaction; use ethereum_types::{H160, H256, U256}; use sp_std::vec::Vec; +#[cfg(feature = "runtime-3000")] +sp_api::decl_runtime_apis! { + #[api_version(5)] + pub trait DebugRuntimeApi { + fn trace_transaction( + extrinsics: Vec, + transaction: &Transaction, + header: &Block::Header, + ) -> Result<(), sp_runtime::DispatchError>; + + fn trace_block( + extrinsics: Vec, + known_transactions: Vec, + header: &Block::Header, + ) -> Result<(), sp_runtime::DispatchError>; + + fn trace_call( + from: H160, + to: H160, + data: Vec, + value: U256, + gas_limit: U256, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Option)>>, + ) -> Result<(), sp_runtime::DispatchError>; + } +} + #[cfg(feature = "runtime-2900")] sp_api::decl_runtime_apis! { #[api_version(5)] From 8df79778609e2cfd7f3494bff4125a655bfca054 Mon Sep 17 00:00:00 2001 From: Rodrigo Quelhas Date: Mon, 6 May 2024 16:04:34 +0100 Subject: [PATCH 2/2] fix features --- tracing/shared/primitives/rpc/debug/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tracing/shared/primitives/rpc/debug/src/lib.rs b/tracing/shared/primitives/rpc/debug/src/lib.rs index bf37dc9..6deb736 100644 --- a/tracing/shared/primitives/rpc/debug/src/lib.rs +++ b/tracing/shared/primitives/rpc/debug/src/lib.rs @@ -76,7 +76,12 @@ sp_api::decl_runtime_apis! { } } -#[cfg(all(not(feature = "before_700"), not(feature = "_700_to_1200"), not(feature = "runtime-2900")))] +#[cfg(all( + not(feature = "before_700"), + not(feature = "_700_to_1200"), + not(feature = "runtime-2900"), + not(feature = "runtime-3000") +))] sp_api::decl_runtime_apis! { #[api_version(4)] pub trait DebugRuntimeApi {