Skip to content

Commit

Permalink
network: Add status func to ReceiptResponse trait
Browse files Browse the repository at this point in the history
  • Loading branch information
moricho committed Jun 7, 2024
1 parent 0928b92 commit b8753e8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/network/src/any/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ impl ReceiptResponse for AnyTransactionReceipt {
fn contract_address(&self) -> Option<alloy_primitives::Address> {
self.contract_address
}

fn status(&self) -> bool {
self.inner.inner.status()
}
}

impl TransactionResponse for WithOtherFields<Transaction> {
Expand Down
4 changes: 4 additions & 0 deletions crates/network/src/ethereum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ impl ReceiptResponse for alloy_rpc_types::TransactionReceipt {
fn contract_address(&self) -> Option<alloy_primitives::Address> {
self.contract_address
}

fn status(&self) -> bool {
self.inner.status()
}
}

impl TransactionResponse for alloy_rpc_types::Transaction {
Expand Down
3 changes: 3 additions & 0 deletions crates/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pub use alloy_eips::eip2718;
pub trait ReceiptResponse {
/// Address of the created contract, or `None` if the transaction was not a deployment.
fn contract_address(&self) -> Option<Address>;

/// Status of the transaction.
fn status(&self) -> bool;
}

/// Transaction Response
Expand Down

0 comments on commit b8753e8

Please sign in to comment.