Skip to content

feat: add TxEnvironment and CfgEnvironment traits#304

Open
figtracer wants to merge 1 commit intoalloy-rs:mainfrom
figtracer:feat/tx-cfg-environment
Open

feat: add TxEnvironment and CfgEnvironment traits#304
figtracer wants to merge 1 commit intoalloy-rs:mainfrom
figtracer:feat/tx-cfg-environment

Conversation

@figtracer
Copy link
Contributor

Add TxEnvironment and CfgEnvironment traits mirroring the existing BlockEnvironment pattern, allowing network-specific transaction and config types to expose their inner revm types via mutable accessors.

  • TxEnvironment: wraps revm::context::TxEnv with tx_env_mut()
  • CfgEnvironment: wraps revm::context::CfgEnv with cfg_env_mut(), reusing the Spec associated type from the Cfg supertraitx

@figtracer figtracer requested review from klkvr and mattsse as code owners March 1, 2026 22:23
@figtracer figtracer force-pushed the feat/tx-cfg-environment branch from 52e4d41 to 9a6a435 Compare March 1, 2026 22:27
Add TxEnvironment and CfgEnvironment traits mirroring the existing
BlockEnvironment pattern, allowing network-specific transaction and
config types to expose their inner revm types via mutable accessors.

- TxEnvironment: wraps revm::context::TxEnv with tx_env_mut()
- CfgEnvironment: wraps revm::context::CfgEnv with cfg_env_mut(),
  reusing the Spec associated type from the Cfg supertrait

Both include blanket impls for the base revm types.
@figtracer figtracer force-pushed the feat/tx-cfg-environment branch from 9a6a435 to 85ee44d Compare March 1, 2026 22:31
@figtracer
Copy link
Contributor Author

update: this one is actually not that important as thought of initially; there's a much simpler way to approach this than to add these. this adds a bit of indirection but it's just better documented

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.

1 participant