You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(anvil)!: simplify PrecompileFactory API to use DynPrecompile (#12411)
* refactor(anvil)!: simplify PrecompileFactory API to use DynPrecompile
Changed PrecompileFactory::precompiles() return type from Vec<(Precompile, u64)> to Vec<(Address, DynPrecompile)> for a cleaner and more flexible API.
The previous API required wrapping precompile functions in the Precompile type with gas limits. The new API directly uses DynPrecompile, which is more straightforward and allows users to create custom precompiles with arbitrary logic without needing to understand the legacy Precompile wrapper.
Updated inject_custom_precompiles to accept the new type and simplified the injection logic to directly apply DynPrecompiles without additional wrapping.
Updated all tests and implementations to use the new API with proper type annotations for closure parameters.
BREAKING CHANGE: PrecompileFactory::precompiles() now returns Vec<(Address, DynPrecompile)> instead of Vec<(Precompile, u64)>
Co-Authored-By: Claude <[email protected]>
* touchup
---------
Co-authored-by: Claude <[email protected]>
0 commit comments