Type Alias RedeemNode

Source
pub type RedeemNode<J> = Node<Redeem<J>>;

Aliased Type§

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

Implementations§

Source§

impl<J: Jet> RedeemNode<J>

Source

pub fn amr(&self) -> Amr

Accessor for the node’s AMR

Source

pub fn imr(&self) -> Imr

Accessor for the node’s IMR

Source

pub fn arrow(&self) -> &FinalArrow

Accessor for the node’s type arrow

Source

pub fn bounds(&self) -> NodeBounds

Accessor for the node’s bit machine bounds

Source

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

Convert a RedeemNode back to a CommitNode by forgetting witnesses and cached data.

Source

pub fn to_witness_node(&self) -> Arc<WitnessNode<J>>

Convert a RedeemNode back into a WitnessNode by loosening the finalized types, witness data and disconnected branches.

Source

pub fn decode<I1, I2>( program: BitIter<I1>, witness: BitIter<I2>, ) -> Result<Arc<Self>, Error>
where I1: Iterator<Item = u8>, I2: Iterator<Item = u8>,

Decode a Simplicity program from bits, including the witness data.

Source

pub fn encode<W1, W2>( &self, prog: &mut BitWriter<W1>, witness: &mut BitWriter<W2>, ) -> Result<usize>
where W1: Write, W2: Write,

Encode the program to bits.

Includes witness data. Returns the number of written bits.

Source

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

Encode the program and witness data to byte vectors.