pub type HeaderBuilderNew = HeaderBuilder<HeaderSetParenting>;

Aliased Type§

struct HeaderBuilderNew(Header, PhantomData<HeaderSetParenting>);

Fields§

§0: Header§1: PhantomData<HeaderSetParenting>

Implementations§

source§

impl HeaderBuilderNew

source

pub fn new(version: BlockVersion, contents: &Contents) -> Self

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

source

pub fn new_raw( version: BlockVersion, content_hash: &BlockContentHash, content_size: BlockContentSize ) -> Self

recommended to use new(), this is only for test

source§

impl HeaderBuilder<HeaderSetParenting>

source

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)
source

pub fn set_parent( self, parent_hash: &HeaderId, chain_length: ChainLength ) -> HeaderBuilder<HeaderSetDate>

Set the header as a general block, with a specific depth and parent hash