Type Alias jormungandr::blockcfg::HeaderBuilderNew
source · pub type HeaderBuilderNew = HeaderBuilder<HeaderSetParenting>;
Aliased Type§
struct HeaderBuilderNew(Header, PhantomData<HeaderSetParenting>);
Fields§
§0: Header
§1: PhantomData<HeaderSetParenting>
Implementations§
source§impl HeaderBuilder<HeaderSetParenting>
impl HeaderBuilder<HeaderSetParenting>
sourcepub fn new(
version: BlockVersion,
contents: &Contents
) -> HeaderBuilder<HeaderSetParenting>
pub fn new( version: BlockVersion, contents: &Contents ) -> HeaderBuilder<HeaderSetParenting>
Create a new Header builder starting from the full content.
This doesn’t need the content directly, but only uses the content to calculate the content hash and the content size, and make sure this is consistent
sourcepub fn new_raw(
version: BlockVersion,
content_hash: &Hash,
content_size: u32
) -> HeaderBuilder<HeaderSetParenting>
pub fn new_raw( version: BlockVersion, content_hash: &Hash, content_size: u32 ) -> HeaderBuilder<HeaderSetParenting>
recommended to use new(), this is only for test
source§impl HeaderBuilder<HeaderSetParenting>
impl HeaderBuilder<HeaderSetParenting>
sourcepub fn set_genesis(self) -> HeaderBuilder<HeaderSetDate>
pub fn set_genesis(self) -> HeaderBuilder<HeaderSetDate>
Set the header as a genesis header:
- the depth starts at 0
- the parent is set to the “null hash” (hash all 0)
sourcepub fn set_parent(
self,
parent_hash: &Hash,
chain_length: ChainLength
) -> HeaderBuilder<HeaderSetDate>
pub fn set_parent( self, parent_hash: &Hash, chain_length: ChainLength ) -> HeaderBuilder<HeaderSetDate>
Set the header as a general block, with a specific depth and parent hash