chore: relax block impl bounds (#13013)

This commit is contained in:
Matthias Seitz
2024-11-29 15:50:12 +01:00
committed by GitHub
parent f6895126dd
commit 7f11fa5368
4 changed files with 7 additions and 5 deletions

View File

@ -30,6 +30,7 @@ pub trait BlockBody:
+ MaybeSerde
+ MaybeArbitrary
+ MaybeSerdeBincodeCompat
+ 'static
{
/// Ordered list of signed transactions as committed in block.
type Transaction: SignedTransaction;

View File

@ -30,6 +30,7 @@ pub trait BlockHeader:
+ MaybeSerde
+ MaybeArbitrary
+ MaybeSerdeBincodeCompat
+ 'static
{
}
@ -50,5 +51,6 @@ impl<T> BlockHeader for T where
+ MaybeSerde
+ MaybeArbitrary
+ MaybeSerdeBincodeCompat
+ 'static
{
}

View File

@ -41,10 +41,10 @@ pub trait Block:
+ MaybeArbitrary
{
/// Header part of the block.
type Header: BlockHeader + 'static;
type Header: BlockHeader;
/// The block's body contains the transactions in the block.
type Body: BlockBody<OmmerHeader = Self::Header> + Send + Sync + Unpin + 'static;
type Body: BlockBody<OmmerHeader = Self::Header>;
/// Create new block instance.
fn new(header: Self::Header, body: Self::Body) -> Self;

View File

@ -457,9 +457,8 @@ where
impl<H, B> reth_primitives_traits::Block for SealedBlock<H, B>
where
H: reth_primitives_traits::BlockHeader + 'static,
B: reth_primitives_traits::BlockBody<OmmerHeader = H> + 'static,
Self: Serialize + for<'a> Deserialize<'a>,
H: reth_primitives_traits::BlockHeader,
B: reth_primitives_traits::BlockBody<OmmerHeader = H>,
{
type Header = H;
type Body = B;