Skip to content

Commit

Permalink
consensus: rm Receipts root_slow unused method (#1567)
Browse files Browse the repository at this point in the history
* consensus: add unit tests for receipts root_slow and refac

* clippy

* rm root_slow fn

* clippy
  • Loading branch information
tcoratger authored Nov 1, 2024
1 parent 1042998 commit 0c09f4c
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/consensus/src/receipt/receipts.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::receipt::{Eip658Value, TxReceipt};
use alloc::{vec, vec::Vec};
use alloy_primitives::{Bloom, Log, B256};
use alloy_primitives::{Bloom, Log};
use alloy_rlp::{length_of_length, BufMut, Decodable, Encodable};
use core::{borrow::Borrow, fmt};
use derive_more::{DerefMut, From, IntoIterator};
Expand Down Expand Up @@ -126,12 +126,6 @@ impl<T> Receipts<T> {
pub fn push(&mut self, receipts: Vec<T>) {
self.receipt_vec.push(receipts);
}

/// Retrieves all recorded receipts from index and calculates the root using the given closure.
pub fn root_slow(&self, index: usize, f: impl FnOnce(&[&T]) -> B256) -> Option<B256> {
let receipts = self.receipt_vec.get(index)?.iter().collect::<Vec<_>>();
Some(f(receipts.as_slice()))
}
}

impl<T> From<Vec<T>> for Receipts<T> {
Expand Down Expand Up @@ -301,6 +295,8 @@ where

#[cfg(test)]
mod test {
use super::*;

#[cfg(feature = "serde")]
#[test]
fn root_vs_status() {
Expand Down

0 comments on commit 0c09f4c

Please sign in to comment.