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

feat: add trace_call to DebugRuntimeApi trait #101

Merged
merged 2 commits into from
May 6, 2024
Merged
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
1 change: 1 addition & 0 deletions tracing/shared/primitives/rpc/debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ default = [ "std" ]
before_700 = []
_700_to_1200 = []
runtime-2900 = []
runtime-3000 = []

std = [
"parity-scale-codec/std",
Expand Down
37 changes: 36 additions & 1 deletion tracing/shared/primitives/rpc/debug/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Block::Extrinsic>,
transaction: &Transaction,
header: &Block::Header,
) -> Result<(), sp_runtime::DispatchError>;

fn trace_block(
extrinsics: Vec<Block::Extrinsic>,
known_transactions: Vec<H256>,
header: &Block::Header,
) -> Result<(), sp_runtime::DispatchError>;

fn trace_call(
from: H160,
to: H160,
data: Vec<u8>,
value: U256,
gas_limit: U256,
max_fee_per_gas: Option<U256>,
max_priority_fee_per_gas: Option<U256>,
nonce: Option<U256>,
access_list: Option<Vec<(H160, Vec<H256>)>>,
) -> Result<(), sp_runtime::DispatchError>;
}
}

#[cfg(feature = "runtime-2900")]
sp_api::decl_runtime_apis! {
#[api_version(5)]
Expand All @@ -46,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 {
Expand Down
Loading