chore: rm receiptsext trait (#13296)

This commit is contained in:
Matthias Seitz
2024-12-11 15:20:27 +01:00
committed by GitHub
parent 6550d82abd
commit 9891917f61
6 changed files with 16 additions and 36 deletions

View File

@ -1,19 +1,16 @@
//! Receipt abstraction
use crate::{InMemorySize, MaybeArbitrary, MaybeCompact, MaybeSerde};
use alloc::vec::Vec;
use core::fmt;
use alloy_consensus::{
Eip2718EncodableReceipt, RlpDecodableReceipt, RlpEncodableReceipt, TxReceipt, Typed2718,
};
use alloy_primitives::B256;
use crate::{InMemorySize, MaybeArbitrary, MaybeCompact, MaybeSerde};
use core::fmt;
/// Helper trait that unifies all behaviour required by receipt to support full node operations.
pub trait FullReceipt: Receipt + MaybeCompact {}
impl<T> FullReceipt for T where T: ReceiptExt + MaybeCompact {}
impl<T> FullReceipt for T where T: Receipt + MaybeCompact {}
/// Abstraction of a receipt.
#[auto_impl::auto_impl(&, Arc)]
@ -35,12 +32,6 @@ pub trait Receipt:
{
}
/// Extension if [`Receipt`] used in block execution.
pub trait ReceiptExt: Receipt {
/// Calculates the receipts root of the given receipts.
fn receipts_root(receipts: &[&Self]) -> B256;
}
/// Retrieves gas spent by transactions as a vector of tuples (transaction index, gas used).
pub fn gas_spent_by_transactions<I, T>(receipts: I) -> Vec<(u64, u64)>
where