diff --git a/ethers-core/src/types/trace/geth.rs b/ethers-core/src/types/trace/geth.rs index 8ea58e11b..eea460edc 100644 --- a/ethers-core/src/types/trace/geth.rs +++ b/ethers-core/src/types/trace/geth.rs @@ -199,6 +199,28 @@ pub struct GethDebugTracingOptions { pub timeout: Option, } +/// Bindings for block overrides in `debug_traceCall` options +/// +/// See +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Default)] +#[serde(rename_all = "camelCase")] +pub struct BlockOverrides { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub number: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub difficulty: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub time: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub gas_limit: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub coinbase: Option
, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub random: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub base_fee: Option, +} + /// Bindings for additional `debug_traceCall` options /// /// See @@ -209,7 +231,8 @@ pub struct GethDebugTracingCallOptions { pub tracing_options: GethDebugTracingOptions, #[serde(default, skip_serializing_if = "Option::is_none")] pub state_overrides: Option, - // TODO: Add blockoverrides options + #[serde(default, skip_serializing_if = "Option::is_none")] + pub block_overrides: Option, } /// Provides types and methods for constructing an `eth_call` diff --git a/examples/transactions/examples/trace_call.rs b/examples/transactions/examples/trace_call.rs index 849f564b4..62ee4ae05 100644 --- a/examples/transactions/examples/trace_call.rs +++ b/examples/transactions/examples/trace_call.rs @@ -27,6 +27,7 @@ async fn main() -> Result<()> { ..Default::default() }, state_overrides: None, + block_overrides: None, }; let traces = client.debug_trace_call(tx, Some(block), options).await?; println!("{traces:?}");