diff --git a/crates/network/src/any/mod.rs b/crates/network/src/any/mod.rs index f815f452211..488988cd48a 100644 --- a/crates/network/src/any/mod.rs +++ b/crates/network/src/any/mod.rs @@ -1,7 +1,6 @@ use crate::{Network, ReceiptResponse}; -use alloy_consensus::AnyReceiptEnvelope; use alloy_rpc_types::{ - Header, Log, Transaction, TransactionReceipt, TransactionRequest, WithOtherFields, + AnyTransactionReceipt, Header, Transaction, TransactionRequest, WithOtherFields, }; mod builder; @@ -29,12 +28,12 @@ impl Network for AnyNetwork { type TransactionResponse = WithOtherFields; - type ReceiptResponse = WithOtherFields>>; + type ReceiptResponse = AnyTransactionReceipt; type HeaderResponse = WithOtherFields
; } -impl ReceiptResponse for WithOtherFields>> { +impl ReceiptResponse for AnyTransactionReceipt { fn contract_address(&self) -> Option { self.contract_address } diff --git a/crates/network/src/ethereum/signer.rs b/crates/network/src/ethereum/signer.rs index 05a818971a7..9197d047527 100644 --- a/crates/network/src/ethereum/signer.rs +++ b/crates/network/src/ethereum/signer.rs @@ -1,5 +1,4 @@ -use super::Ethereum; -use crate::{NetworkSigner, TxSigner}; +use crate::{Network, NetworkSigner, TxSigner}; use alloy_consensus::{SignableTransaction, TxEnvelope, TypedTransaction}; use alloy_signer::Signature; use async_trait::async_trait; @@ -43,7 +42,10 @@ impl EthereumSigner { #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] #[cfg_attr(not(target_arch = "wasm32"), async_trait)] -impl NetworkSigner for EthereumSigner { +impl NetworkSigner for EthereumSigner +where + N: Network, +{ async fn sign_transaction(&self, tx: TypedTransaction) -> alloy_signer::Result { match tx { TypedTransaction::Legacy(mut t) => { diff --git a/crates/rpc-types/src/eth/transaction/mod.rs b/crates/rpc-types/src/eth/transaction/mod.rs index c9a3a1d9f75..660d96aac36 100644 --- a/crates/rpc-types/src/eth/transaction/mod.rs +++ b/crates/rpc-types/src/eth/transaction/mod.rs @@ -22,7 +22,7 @@ pub use optimism::OptimismTransactionReceiptFields; mod receipt; pub use alloy_consensus::{AnyReceiptEnvelope, Receipt, ReceiptEnvelope, ReceiptWithBloom}; -pub use receipt::TransactionReceipt; +pub use receipt::{AnyTransactionReceipt, TransactionReceipt}; pub mod request; pub use request::{TransactionInput, TransactionRequest}; diff --git a/crates/rpc-types/src/eth/transaction/receipt.rs b/crates/rpc-types/src/eth/transaction/receipt.rs index 1ed7effd97f..b055ff56e8f 100644 --- a/crates/rpc-types/src/eth/transaction/receipt.rs +++ b/crates/rpc-types/src/eth/transaction/receipt.rs @@ -1,5 +1,5 @@ -use crate::Log; -use alloy_consensus::{ReceiptEnvelope, TxType}; +use crate::{Log, WithOtherFields}; +use alloy_consensus::{AnyReceiptEnvelope, ReceiptEnvelope, TxType}; use alloy_primitives::{Address, B256}; use serde::{Deserialize, Serialize}; @@ -115,6 +115,9 @@ impl TransactionReceipt { } } +/// Alias for a catch-all receipt type. +pub type AnyTransactionReceipt = WithOtherFields>>; + #[cfg(test)] mod test { use super::*;