foundry_primitives/network/mod.rs
1use alloy_network::Network;
2
3mod receipt;
4
5pub use receipt::FoundryTxReceipt;
6
7/// Foundry network type.
8///
9/// This network type supports Foundry-specific transaction types, including
10/// op-stack deposit transactions, alongside standard Ethereum transaction types.
11///
12/// Note: This is a basic implementation ("for now") that provides the core Network
13/// trait definitions. Full Foundry-specific RPC types will be implemented in future work.
14/// Currently, this uses Ethereum's Network configuration as a compatibility layer.
15#[derive(Debug, Clone, Copy)]
16pub struct FoundryNetwork {
17 _private: (),
18}
19
20// Use Ethereum's Network trait implementation as the basis.
21// This provides compatibility with the alloy-network ecosystem while we build
22// out Foundry-specific RPC types.
23impl Network for FoundryNetwork {
24 type TxType = crate::FoundryTxType;
25
26 type TxEnvelope = crate::FoundryTxEnvelope;
27
28 type UnsignedTx = crate::FoundryTypedTx;
29
30 type ReceiptEnvelope = crate::FoundryReceiptEnvelope;
31
32 type Header = alloy_consensus::Header;
33
34 type TransactionRequest = crate::FoundryTransactionRequest;
35
36 type TransactionResponse = op_alloy_rpc_types::Transaction<crate::FoundryTxEnvelope>;
37
38 type ReceiptResponse = crate::FoundryTxReceipt;
39
40 type HeaderResponse = alloy_rpc_types_eth::Header;
41
42 type BlockResponse =
43 alloy_rpc_types_eth::Block<Self::TransactionResponse, Self::HeaderResponse>;
44}