Skip to content

refactor(cheatcodes): BroadcastableTransaction network-agnostic#13849

Merged
zerosnacks merged 1 commit intofoundry-rs:masterfrom
figtracer:refactor/broadcastable-tx-no-network
Mar 19, 2026
Merged

refactor(cheatcodes): BroadcastableTransaction network-agnostic#13849
zerosnacks merged 1 commit intofoundry-rs:masterfrom
figtracer:refactor/broadcastable-tx-no-network

Conversation

@figtracer
Copy link
Contributor

Remove the Network type parameter from BroadcastableTransaction by storing raw EVM data (from, to, value, input, nonce, gas) as primitive fields instead of wrapping TransactionMaybeSigned<N>.

This prevents the Network generic from leaking through Cheatcodes, RawCallResult, and ScriptResult. The conversion to network-specific types (TransactionMaybeSigned<Ethereum>) now happens in the script layer (simulate.rs) at the point where transactions are handed off to ScriptTransactionBuilder.

This will need a follow-up to take care of making this into_maybe_signed() generic.

Remove the `Network` type parameter from `BroadcastableTransaction` by
storing raw EVM data (from, to, value, input, nonce, gas) as primitive
fields instead of wrapping `TransactionMaybeSigned<N>`.

This prevents the `Network` generic from leaking through `Cheatcodes`,
`RawCallResult`, and `ScriptResult`. The conversion to network-specific
types (`TransactionMaybeSigned<Ethereum>`) now happens in the script
layer (`simulate.rs`) at the point where transactions are handed off to
`ScriptTransactionBuilder`.
@figtracer figtracer force-pushed the refactor/broadcastable-tx-no-network branch from 8e188c6 to d2a5810 Compare March 19, 2026 14:18
Copy link
Member

@zerosnacks zerosnacks left a comment

Choose a reason for hiding this comment

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

👍 !

@zerosnacks zerosnacks enabled auto-merge (squash) March 19, 2026 14:20
@zerosnacks zerosnacks merged commit 8a31326 into foundry-rs:master Mar 19, 2026
16 checks passed
@github-project-automation github-project-automation bot moved this to Done in Foundry Mar 19, 2026
@figtracer figtracer deleted the refactor/broadcastable-tx-no-network branch March 19, 2026 15:04
figtracer added a commit to figtracer/foundry that referenced this pull request Mar 19, 2026
Replace Ethereum-specific struct construction with `TransactionBuilder`
and `FoundryTransactionBuilder` trait methods, allowing the conversion
from `BroadcastableTransaction` to `TransactionMaybeSigned<N>` to work
for any network.

Also remove dead `TransactionMaybeSigned::new` and `new_signed`
constructors that are no longer used after foundry-rs#13849.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants