alloy-rs / alloy

Transports, Middleware, and Networks for the Alloy project
https://alloy.rs
Apache License 2.0
653 stars 236 forks source link

fix(`network`): impl `NetworkWallet<AnyNetwork>` #1631

Closed yash-atreya closed 2 weeks ago

yash-atreya commented 2 weeks ago

Motivation

In https://github.com/alloy-rs/alloy/pull/1460, AnyTxEnvelope and AnyTypedTransaction were introduced. These are now being used in AnyNetwork.

This made initializing an AnyNetwork provider with the EthereumWallet wallet filler incompatible as it signs TypedTransaction and returns the TxEnvelope.

Solution

Implmenent NetworkWallet<AnyNetwork> for EthereumWallet that sign AnyTypedTransactions

PR Checklist

yash-atreya commented 2 weeks ago

I don't think we need a separate type here given that signable transactions set is still the same

In op-alloy I've done this https://github.com/alloy-rs/op-alloy/blob/01f11b4747f3b533f947be19188099cb21182a1a/crates/network/src/lib.rs#L198 which allows to reuse EthereumWallet for OP as well

@klkvr addressed in 55144c2