From b7e8d5aa3e81cfadd92f2c816732d4ad1a7b011c Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 13 Nov 2024 09:34:20 +0100 Subject: [PATCH] chore: add SealedHeader::seal (#12497) --- crates/primitives-traits/src/header/sealed.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/primitives-traits/src/header/sealed.rs b/crates/primitives-traits/src/header/sealed.rs index b0fe44342988..145e2722bfa3 100644 --- a/crates/primitives-traits/src/header/sealed.rs +++ b/crates/primitives-traits/src/header/sealed.rs @@ -56,6 +56,14 @@ impl SealedHeader { } } +impl SealedHeader { + /// Hashes the header and creates a sealed header. + pub fn seal(header: H) -> Self { + let hash = header.hash_slow(); + Self::new(header, hash) + } +} + impl SealedHeader { /// Return the number hash tuple. pub fn num_hash(&self) -> BlockNumHash {