chore: move serde bincode compat bound to NodePrimitives (#13393)

This commit is contained in:
Arsenii Kulikov
2024-12-13 23:33:53 +04:00
committed by GitHub
parent fb962fcd1b
commit 138004bf3b
4 changed files with 17 additions and 17 deletions

View File

@ -9,9 +9,9 @@ use alloy_eips::{eip2718::Encodable2718, eip4895::Withdrawals};
use alloy_primitives::{Bytes, B256};
/// Helper trait that unifies all behaviour required by transaction to support full node operations.
pub trait FullBlockBody: BlockBody<Transaction: FullSignedTx> {}
pub trait FullBlockBody: BlockBody<Transaction: FullSignedTx> + MaybeSerdeBincodeCompat {}
impl<T> FullBlockBody for T where T: BlockBody<Transaction: FullSignedTx> {}
impl<T> FullBlockBody for T where T: BlockBody<Transaction: FullSignedTx> + MaybeSerdeBincodeCompat {}
/// Abstraction for block's body.
pub trait BlockBody:
@ -27,7 +27,6 @@ pub trait BlockBody:
+ alloy_rlp::Decodable
+ InMemorySize
+ MaybeSerde
+ MaybeSerdeBincodeCompat
+ 'static
{
/// Ordered list of signed transactions as committed in block.

View File

@ -1,7 +1,4 @@
use crate::{
Block, BlockBody, BlockHeader, FullBlock, FullBlockBody, FullBlockHeader, FullReceipt,
FullSignedTx, Receipt, SignedTransaction,
};
use crate::{Block, FullBlock, FullBlockBody, FullBlockHeader, FullReceipt, FullSignedTx, Receipt};
use core::fmt;
/// Configures all the primitive types of the node.
@ -11,11 +8,11 @@ pub trait NodePrimitives:
/// Block primitive.
type Block: Block<Header = Self::BlockHeader, Body = Self::BlockBody>;
/// Block header primitive.
type BlockHeader: BlockHeader;
type BlockHeader: FullBlockHeader;
/// Block body primitive.
type BlockBody: BlockBody<Transaction = Self::SignedTx, OmmerHeader = Self::BlockHeader>;
type BlockBody: FullBlockBody<Transaction = Self::SignedTx, OmmerHeader = Self::BlockHeader>;
/// Signed version of the transaction type.
type SignedTx: SignedTransaction + 'static;
type SignedTx: FullSignedTx;
/// A receipt.
type Receipt: Receipt;
}