Skip to content

Commit

Permalink
chore(sdk): SealedHeader generic over header (#11429)
Browse files Browse the repository at this point in the history
  • Loading branch information
emhane authored Oct 4, 2024
1 parent b537672 commit 16c39d9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crates/primitives-traits/src/header/sealed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,24 @@ use serde::{Deserialize, Serialize};
/// to modify header.
#[derive(Debug, Clone, PartialEq, Eq, Hash, AsRef, Deref, Serialize, Deserialize)]
#[add_arbitrary_tests(rlp)]
pub struct SealedHeader {
pub struct SealedHeader<H = Header> {
/// Locked Header hash.
hash: BlockHash,
/// Locked Header fields.
#[as_ref]
#[deref]
header: Header,
header: H,
}

impl SealedHeader {
impl<H> SealedHeader<H> {
/// Creates the sealed header with the corresponding block hash.
#[inline]
pub const fn new(header: Header, hash: BlockHash) -> Self {
pub const fn new(header: H, hash: BlockHash) -> Self {
Self { header, hash }
}
}

impl SealedHeader {
/// Returns the sealed Header fields.
#[inline]
pub const fn header(&self) -> &Header {
Expand Down

0 comments on commit 16c39d9

Please sign in to comment.