mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: introduce helper alias type (#14058)
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
mod sealed;
|
||||
pub use sealed::{Header, SealedHeader};
|
||||
pub use sealed::{Header, SealedHeader, SealedHeaderFor};
|
||||
|
||||
mod error;
|
||||
pub use error::HeaderError;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
use crate::{sync::OnceLock, InMemorySize};
|
||||
use crate::{sync::OnceLock, InMemorySize, NodePrimitives};
|
||||
pub use alloy_consensus::Header;
|
||||
use alloy_consensus::Sealed;
|
||||
use alloy_eips::{eip1898::BlockWithParent, BlockNumHash};
|
||||
@ -8,6 +8,9 @@ use bytes::BufMut;
|
||||
use core::mem;
|
||||
use derive_more::{AsRef, Deref};
|
||||
|
||||
/// Type alias for [`SealedHeader`] generic over the `BlockHeader` type of [`NodePrimitives`].
|
||||
pub type SealedHeaderFor<N> = SealedHeader<<N as NodePrimitives>::BlockHeader>;
|
||||
|
||||
/// Seals the header with the block hash.
|
||||
///
|
||||
/// This type uses lazy sealing to avoid hashing the header until it is needed:
|
||||
|
||||
@ -120,7 +120,7 @@ pub mod sync;
|
||||
|
||||
/// Common header types
|
||||
pub mod header;
|
||||
pub use header::{Header, HeaderError, SealedHeader};
|
||||
pub use header::{Header, HeaderError, SealedHeader, SealedHeaderFor};
|
||||
|
||||
/// Bincode-compatible serde implementations for common abstracted types in Reth.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user