use alloy_network::ReceiptResponse;
use alloy_primitives::{Address, B256, BlockHash, TxHash};
use alloy_rpc_types::TransactionReceipt;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PodReceiptResponse {
#[serde(flatten)]
pub receipt: TransactionReceipt,
}
impl std::ops::Deref for PodReceiptResponse {
type Target = TransactionReceipt;
fn deref(&self) -> &TransactionReceipt {
&self.receipt
}
}
impl ReceiptResponse for PodReceiptResponse {
fn contract_address(&self) -> Option<Address> {
None
}
fn status(&self) -> bool {
self.receipt.status()
}
fn block_hash(&self) -> Option<BlockHash> {
Some(BlockHash::default())
}
fn block_number(&self) -> Option<u64> {
None
}
fn transaction_hash(&self) -> TxHash {
self.receipt.transaction_hash()
}
fn transaction_index(&self) -> Option<u64> {
None
}
fn gas_used(&self) -> u64 {
self.receipt.gas_used()
}
fn effective_gas_price(&self) -> u128 {
self.receipt.effective_gas_price()
}
fn blob_gas_used(&self) -> Option<u64> {
None
}
fn blob_gas_price(&self) -> Option<u128> {
None
}
fn from(&self) -> Address {
self.receipt.from()
}
fn to(&self) -> Option<Address> {
self.receipt.to()
}
fn cumulative_gas_used(&self) -> u64 {
self.receipt.cumulative_gas_used()
}
fn state_root(&self) -> Option<B256> {
None
}
}