Type Alias ConstructNode

Source
pub type ConstructNode<J> = Node<Construct<J>>;

Aliased Type§

pub 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_non_program 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 finalize_unpruned(&self) -> Result<Arc<RedeemNode<J>>, FinalizeError>

Finalize the witness program as an unpruned redeem program.

Witness nodes must be populated with sufficient data, to ensure that the resulting redeem program successfully runs on the Bit Machine. Furthermore, all disconnected branches must be populated, even those that are not executed.

The resulting redeem program is not pruned.

§See

RedeemNode::prune

Source

pub fn finalize_pruned( &self, env: &J::Environment, ) -> Result<Arc<RedeemNode<J>>, FinalizeError>

Finalize the witness program as a pruned redeem program.

Witness nodes must be populated with sufficient data, to ensure that the resulting redeem program successfully runs on the Bit Machine. Furthermore, all disconnected branches must be populated, even those that are not executed.

The resulting redeem program is pruned based on the given transaction environment.

§See

RedeemNode::prune

Source

pub fn decode<I: Iterator<Item = u8>>( bits: 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 crate::RedeemNode::decode().

Source

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

👎Deprecated since 0.5.0: use Self::encode_without_witness instead

Encode a Simplicity expression to bits, with no witness data