Skip to content

Commit

Permalink
chore: add SealedHeader::seal (#12497)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Nov 13, 2024
1 parent 2f794b6 commit b7e8d5a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/primitives-traits/src/header/sealed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b7e8d5a

Please sign in to comment.