Skip to content

Commit

Permalink
feat: use AnyReceiptEnvelope for AnyNetwork
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Apr 4, 2024
1 parent 50abf99 commit b609a3d
Show file tree
Hide file tree
Showing 2 changed files with 1,406 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/network/src/any/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{Network, ReceiptResponse};
use alloy_consensus::AnyReceiptEnvelope;
use alloy_rpc_types::{
Header, Transaction, TransactionReceipt, TransactionRequest, WithOtherFields,
Header, Log, Transaction, TransactionReceipt, TransactionRequest, WithOtherFields,
};

mod builder;
Expand All @@ -20,20 +21,20 @@ impl Network for AnyNetwork {

type UnsignedTx = alloy_consensus::TypedTransaction;

type ReceiptEnvelope = alloy_consensus::ReceiptEnvelope;
type ReceiptEnvelope = alloy_consensus::AnyReceiptEnvelope;

type Header = alloy_consensus::Header;

type TransactionRequest = WithOtherFields<TransactionRequest>;

type TransactionResponse = WithOtherFields<Transaction>;

type ReceiptResponse = WithOtherFields<TransactionReceipt>;
type ReceiptResponse = WithOtherFields<TransactionReceipt<AnyReceiptEnvelope<Log>>>;

type HeaderResponse = WithOtherFields<Header>;
}

impl ReceiptResponse for WithOtherFields<TransactionReceipt> {
impl ReceiptResponse for WithOtherFields<TransactionReceipt<AnyReceiptEnvelope<Log>>> {
fn contract_address(&self) -> Option<alloy_primitives::Address> {
self.contract_address
}
Expand Down
Loading

0 comments on commit b609a3d

Please sign in to comment.