Type Alias simplicity::node::CommitNode

source ·
pub type CommitNode<J> = Node<Commit<J>>;

Aliased Type§

struct CommitNode<J> { /* private fields */ }

Implementations§

source§

impl<J: Jet> CommitNode<J>

source

pub fn arrow(&self) -> &FinalArrow

Accessor for the node’s arrow

source

pub fn amr(&self) -> Option<Amr>

Accessor for the node’s AMR, if known

source

pub fn imr(&self) -> Option<Imr>

Accessor for the node’s IMR, if known

source

pub fn finalize<C: Converter<Commit<J>, Redeem<J>>>( &self, converter: &mut C ) -> Result<Arc<RedeemNode<J>>, C::Error>

Finalizes a DAG, by iterating through through it without sharing, attaching witnesses, and hiding branches.

This is a thin wrapper around Node::convert which fixes a few types to make it easier to use.

source

pub fn unfinalize_types(&self) -> Result<Arc<ConstructNode<J>>, Error>

Convert a CommitNode back to a ConstructNode by redoing type inference

source

pub fn decode<I: Iterator<Item = u8>>( bits: &mut BitIter<I> ) -> Result<Arc<Self>, Error>

Decode a Simplicity program from bits, without witness data.

§Usage

Use this method only if the serialization does not include the witness data. This means, the program simply has no witness during commitment, or the witness is provided by other means.

If the serialization contains the witness data, then use RedeemNode::decode().

source

pub fn encode<W: Write>(&self, w: &mut BitWriter<W>) -> Result<usize>

Encode a Simplicity expression to bits without any witness data

source

pub fn encode_to_vec(&self) -> Vec<u8>

Encode a Simplicity program to a vector of bytes, without any witness data.