chore: add SealedHeader::seal (#12497)

This commit is contained in:
Matthias Seitz
2024-11-13 09:34:20 +01:00
committed by GitHub
parent 2f794b6b99
commit b7e8d5aa3e

View File

@ -56,6 +56,14 @@ impl<H> SealedHeader<H> {
}
}
impl<H: Sealable> SealedHeader<H> {
/// Hashes the header and creates a sealed header.
pub fn seal(header: H) -> Self {
let hash = header.hash_slow();
Self::new(header, hash)
}
}
impl<H: alloy_consensus::BlockHeader> SealedHeader<H> {
/// Return the number hash tuple.
pub fn num_hash(&self) -> BlockNumHash {