mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: move serde bincode compat bound to NodePrimitives (#13393)
This commit is contained in:
@ -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.
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user