Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update AnyNetwork type aliases #1591

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/network/src/any/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::Network;
use alloy_consensus::TxType;
use alloy_eips::eip2718::Eip2718Error;
use alloy_rpc_types_eth::{AnyTransactionReceipt, Block, Transaction, TransactionRequest};
use alloy_rpc_types_eth::{AnyTransactionReceipt, Transaction, TransactionRequest};
use alloy_serde::WithOtherFields;
use core::fmt;

Expand Down Expand Up @@ -73,7 +73,7 @@ impl Network for AnyNetwork {

type ReceiptResponse = AnyTransactionReceipt;

type HeaderResponse = alloy_rpc_types_eth::Header<Self::Header>;
type HeaderResponse = alloy_rpc_types_eth::AnyNetworkHeader;

type BlockResponse = WithOtherFields<Block<Self::TransactionResponse, Self::HeaderResponse>>;
type BlockResponse = alloy_rpc_types_eth::AnyNetworkBlock;
}
5 changes: 4 additions & 1 deletion crates/rpc-types-eth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ pub use block::*;
#[cfg(feature = "serde")]
use alloy_serde::WithOtherFields;

/// A catch-all header type for handling headers on multiple networks.
pub type AnyNetworkHeader = Header<alloy_consensus::AnyHeader>;

/// A catch-all block type for handling blocks on multiple networks.
#[cfg(feature = "serde")]
pub type AnyNetworkBlock = WithOtherFields<Block<WithOtherFields<Transaction>>>;
pub type AnyNetworkBlock = WithOtherFields<Block<WithOtherFields<Transaction>, AnyNetworkHeader>>;

pub use alloy_network_primitives::{
BlockTransactionHashes, BlockTransactions, BlockTransactionsKind,
Expand Down