Skip to content

Conversation

@stevencartavia
Copy link
Contributor

Motivation

closes #119

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@klkvr klkvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move this to crates/evm/src/evm.rs and add a helper

fn with_modified_precompiles<F>(self, f: F) -> EvmFactoryWith<Self, F> 
where 
    F: Fn(&mut PrecompilesMap, Self::Spec)

to EvmFactoryExt here:

pub trait EvmFactoryExt: EvmFactory {

}

/// Trait for modifying precompiles based on spec ID.
pub trait PrecompileModifies<SpecId> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add a blanket impl for Fn(&mut PrecompilesMap, SpecId)

@klkvr
Copy link
Member

klkvr commented Jul 19, 2025

I'm also wondering if we shuld have a more general trait EvmOverrides that would take &mut F::Evm? that way PrecompileOverrides can be just a subset of it while allowing for e.g EvmFactoryExt::with_evm_overrides

wdyt @mattsse

@mattsse
Copy link
Member

mattsse commented Jul 29, 2025

@klkvr should this then be called trait EvmExt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add helper EvmFactory type that modifies the PrecompilesMap

3 participants