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>
impl<J: Jet> CommitNode<J>
sourcepub fn arrow(&self) -> &FinalArrow
pub fn arrow(&self) -> &FinalArrow
Accessor for the node’s arrow
sourcepub fn finalize<C: Converter<Commit<J>, Redeem<J>>>(
&self,
converter: &mut C
) -> Result<Arc<RedeemNode<J>>, C::Error>
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.
sourcepub fn unfinalize_types(&self) -> Result<Arc<ConstructNode<J>>, Error>
pub fn unfinalize_types(&self) -> Result<Arc<ConstructNode<J>>, Error>
Convert a CommitNode back to a ConstructNode by redoing type inference
sourcepub fn decode<I: Iterator<Item = u8>>(
bits: &mut BitIter<I>
) -> Result<Arc<Self>, Error>
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().
sourcepub fn encode<W: Write>(&self, w: &mut BitWriter<W>) -> Result<usize>
pub fn encode<W: Write>(&self, w: &mut BitWriter<W>) -> Result<usize>
Encode a Simplicity expression to bits without any witness data
sourcepub fn encode_to_vec(&self) -> Vec<u8>
pub fn encode_to_vec(&self) -> Vec<u8>
Encode a Simplicity program to a vector of bytes, without any witness data.