Skip to content

[Feature] Use initializer for Inspector reset #132

@mattsse

Description

@mattsse

Describe the feature you would like

we currently rely on clone and do a mandatory clone to store the initial state:

/// Creates a new [`TxTracer`] instance.
pub fn new(mut evm: E) -> Self {
Self { fused_inspector: evm.inspector_mut().clone(), evm }
}

this does not work for non clone inspectors:

https://github.com/paradigmxyz/revm-inspectors/blob/eb6ed5965050e8723ccf1ec02b0b53f7f0005af5/src/tracing/js/mod.rs#L56-L57

instead we can introduce an Init generic that is

FnMut() ->  E::Inspector

and by default

let fused = ins.clone();
let init = move || ins.clone();

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions