pub type ConstructNode<J> = Node<Construct<J>>;
Aliased Type§
pub struct ConstructNode<J> { /* private fields */ }
Implementations§
Source§impl<J: Jet> ConstructNode<J>
impl<J: Jet> ConstructNode<J>
Sourcepub fn set_arrow_to_program(&self) -> Result<(), Error>
pub fn set_arrow_to_program(&self) -> Result<(), Error>
Sets the source and target type of the node to unit
Sourcepub fn finalize_types(&self) -> Result<Arc<CommitNode<J>>, Error>
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.
Sourcepub fn finalize_types_non_program(&self) -> Result<Arc<CommitNode<J>>, Error>
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.
Sourcepub fn finalize_unpruned(&self) -> Result<Arc<RedeemNode<J>>, FinalizeError>
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
Sourcepub fn finalize_pruned(
&self,
env: &J::Environment,
) -> Result<Arc<RedeemNode<J>>, FinalizeError>
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
Sourcepub fn decode<I: Iterator<Item = u8>>(
bits: BitIter<I>,
) -> Result<Arc<Self>, Error>
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()
.