feat(reth-execution-types): make generic DisplayBlocksChain (#13336)

This commit is contained in:
Tien Nguyen
2024-12-12 18:47:02 +07:00
committed by GitHub
parent b19eb79664
commit 92fae83c0d

View File

@ -374,9 +374,11 @@ impl<N: NodePrimitives> Chain<N> {
/// Wrapper type for `blocks` display in `Chain` /// Wrapper type for `blocks` display in `Chain`
#[derive(Debug)] #[derive(Debug)]
pub struct DisplayBlocksChain<'a>(pub &'a BTreeMap<BlockNumber, SealedBlockWithSenders>); pub struct DisplayBlocksChain<'a, B: reth_primitives_traits::Block>(
pub &'a BTreeMap<BlockNumber, SealedBlockWithSenders<B>>,
);
impl fmt::Display for DisplayBlocksChain<'_> { impl<B: reth_primitives_traits::Block> fmt::Display for DisplayBlocksChain<'_, B> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut list = f.debug_list(); let mut list = f.debug_list();
let mut values = self.0.values().map(|block| block.num_hash()); let mut values = self.0.values().map(|block| block.num_hash());