Type Alias simplicity::node::ConstructNode

source ·
pub type ConstructNode<J> = Node<Construct<J>>;

Aliased Type§

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

Implementations§

source§

impl<J: Jet> ConstructNode<J>

source

pub fn arrow(&self) -> &Arrow

Accessor for the node’s arrow

source

pub fn set_arrow_to_program(&self) -> Result<(), Error>

Sets the source and target type of the node to unit

source

pub fn finalize_types(&self) -> Result<Arc<CommitNode<J>>, Error>

Convert a ConstructNode to a CommitNode by finalizing all of the types.

Also sets the source and target type of this node to unit. This is almost certainly what you want, since the resulting CommitNode cannot be further composed, and needs to be 1->1 to go on-chain. But if you don’t, call [Self::finalize_types_without_fixing] instead.

source

pub fn finalize_types_non_program(&self) -> Result<Arc<CommitNode<J>>, Error>

Convert a ConstructNode to a CommitNode by finalizing all of the types.

Does not sets the source and target type of this node to unit.

source

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

Decode a Simplicity expression 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, with no witness data