pub trait Version {
    type NodeData: Debug;

    fn consensus_branch_id(data: &Self::NodeData) -> u32;
    fn start_height(data: &Self::NodeData) -> u64;
    fn end_height(data: &Self::NodeData) -> u64;
    fn combine_inner(
        subtree_commitment: [u8; 32],
        left: &Self::NodeData,
        right: &Self::NodeData
    ) -> Self::NodeData; fn read<R: Read>(
        consensus_branch_id: u32,
        r: &mut R
    ) -> Result<Self::NodeData>; fn write<W: Write>(data: &Self::NodeData, w: &mut W) -> Result<()>; fn combine(left: &Self::NodeData, right: &Self::NodeData) -> Self::NodeData { ... } fn to_bytes(data: &Self::NodeData) -> Vec<u8> { ... } fn from_bytes<T: AsRef<[u8]>>(
        consensus_branch_id: u32,
        buf: T
    ) -> Result<Self::NodeData> { ... } fn hash(data: &Self::NodeData) -> [u8; 32] { ... } }
Expand description

A version of the chain history tree.

Required Associated Types

The node data for this tree version.

Required Methods

Returns the consensus branch ID for the given node data.

Returns the start height for the given node data.

Returns the end height for the given node data.

Combines two nodes metadata.

For internal use.

Parses node data from the given reader.

Writes the byte representation of the given node data to the given writer.

Provided Methods

Combines two nodes’ metadata.

Converts to byte representation.

Convert from byte representation.

Hash node metadata

Implementors