Skip to content

Commit

Permalink
chore: manual default impl (#1813)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Dec 19, 2024
1 parent fe122df commit b59587f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crates/consensus/src/block/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use alloy_rlp::{Decodable, Encodable, RlpDecodable, RlpEncodable};
/// Taken from [reth-primitives](https://github.com/paradigmxyz/reth)
///
/// See p2p block encoding reference: <https://github.com/ethereum/devp2p/blob/master/caps/eth.md#block-encoding-and-validity>
#[derive(Debug, Clone, PartialEq, Eq, Default)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Block<T, H = Header> {
/// Block header.
pub header: H,
Expand All @@ -34,6 +34,15 @@ impl<T, H> Block<T, H> {
}
}

impl<T, H> Default for Block<T, H>
where
H: Default,
{
fn default() -> Self {
Self { header: Default::default(), body: Default::default() }
}
}

#[cfg(any(test, feature = "arbitrary"))]
impl<'a, T> arbitrary::Arbitrary<'a> for Block<T>
where
Expand Down

0 comments on commit b59587f

Please sign in to comment.