Skip to content

Commit

Permalink
feat: use generic block in CanonicalStateUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Dec 12, 2024
1 parent f7dc27f commit cdc18fa
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/transaction-pool/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use std::{
sync::Arc,
task::{Context, Poll},
};
use std::hash::Hash;
use tokio::sync::mpsc::Receiver;

/// The `PeerId` type.
Expand Down Expand Up @@ -717,9 +718,9 @@ pub enum PoolUpdateKind {
///
/// This is used to update the pool state accordingly.
#[derive(Clone, Debug)]
pub struct CanonicalStateUpdate<'a> {
pub struct CanonicalStateUpdate<'a, B = reth_primitives::Block> {
/// Hash of the tip block.
pub new_tip: &'a SealedBlock,
pub new_tip: &'a B,
/// EIP-1559 Base fee of the _next_ (pending) block
///
/// The base fee of a block depends on the utilization of the last block and its base fee.
Expand All @@ -742,11 +743,6 @@ impl CanonicalStateUpdate<'_> {
self.new_tip.number
}

/// Returns the hash of the tip block.
pub const fn hash(&self) -> B256 {
self.new_tip.hash()
}

/// Timestamp of the latest chain update
pub fn timestamp(&self) -> u64 {
self.new_tip.timestamp
Expand Down

0 comments on commit cdc18fa

Please sign in to comment.