Skip to content

Commit

Permalink
feat: add missing new fn
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Dec 3, 2024
1 parent 36b0931 commit e0d8b37
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/rpc-types-trace/src/geth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,11 @@ pub struct GethDebugTracingCallOptions {
}

impl GethDebugTracingCallOptions {
/// Creates a new instance with the given tracing options
pub const fn new(tracing_options: GethDebugTracingOptions) -> Self {
Self { tracing_options, state_overrides: None, block_overrides: None }
}

/// Enables state overrides
pub fn with_state_overrides(mut self, overrides: StateOverride) -> Self {
self.state_overrides = Some(overrides);
Expand All @@ -687,6 +692,12 @@ impl GethDebugTracingCallOptions {
}
}

impl From<GethDebugTracingOptions> for GethDebugTracingCallOptions {
fn from(value: GethDebugTracingOptions) -> Self {
Self::new(value)
}
}

/// Serializes a storage map as a list of key-value pairs _without_ 0x-prefix
fn serialize_string_storage_map_opt<S: Serializer>(
storage: &Option<BTreeMap<B256, B256>>,
Expand Down

0 comments on commit e0d8b37

Please sign in to comment.