reth_primitives_traits/
receipt.rsuse crate::{InMemorySize, MaybeCompact, MaybeSerde};
use alloc::vec::Vec;
use alloy_consensus::{
Eip2718EncodableReceipt, RlpDecodableReceipt, RlpEncodableReceipt, TxReceipt, Typed2718,
};
use core::fmt;
pub trait FullReceipt: Receipt + MaybeCompact {}
impl<T> FullReceipt for T where T: Receipt + MaybeCompact {}
#[auto_impl::auto_impl(&, Arc)]
pub trait Receipt:
Send
+ Sync
+ Unpin
+ Clone
+ fmt::Debug
+ TxReceipt<Log = alloy_primitives::Log>
+ RlpEncodableReceipt
+ RlpDecodableReceipt
+ Eip2718EncodableReceipt
+ Typed2718
+ MaybeSerde
+ InMemorySize
{
}
pub fn gas_spent_by_transactions<I, T>(receipts: I) -> Vec<(u64, u64)>
where
I: IntoIterator<Item = T>,
T: TxReceipt,
{
receipts
.into_iter()
.enumerate()
.map(|(id, receipt)| (id as u64, receipt.cumulative_gas_used() as u64))
.collect()
}