Struct SimpleFinalizer

Source
pub struct SimpleFinalizer<W: Iterator<Item = Value>> { /* private fields */ }
Expand description

Basic finalizer which converts a super::CommitNode to a super::RedeemNode by attaching witness data from an iterator.

Does not do any type-checking and may attach an invalid witness to a combinator.

If it encounters a disconnect node, it simply returns an error.

This finalizer should not be used in production. It introduces default values (Value::zero) to handle missing witness data, which might trigger unexpected spending paths.

Implementations§

Source§

impl<W: Iterator<Item = Value>> SimpleFinalizer<W>

Source

pub fn new(iter: W) -> Self

Trait Implementations§

Source§

impl<W: Iterator<Item = Value>, J: Jet> Converter<Commit<J>, Redeem<J>> for SimpleFinalizer<W>

Source§

type Error = FinalizeError

The error type returned by the methods on this trait.
Source§

fn convert_witness( &mut self, data: &PostOrderIterItem<&CommitNode<J>>, _: &NoWitness, ) -> Result<Value, Self::Error>

For witness nodes, this method is called first to attach witness data to the node. Read more
Source§

fn convert_disconnect( &mut self, _: &PostOrderIterItem<&CommitNode<J>>, _: Option<&Arc<RedeemNode<J>>>, _: &NoDisconnect, ) -> Result<Arc<RedeemNode<J>>, Self::Error>

For disconnect nodes, this method is called first to attach a disconnected expression to the node. Read more
Source§

fn convert_data( &mut self, data: &PostOrderIterItem<&CommitNode<J>>, inner: Inner<&Arc<RedeemNode<J>>, J, &Arc<RedeemNode<J>>, &Value>, ) -> Result<Arc<RedeemData<J>>, Self::Error>

This method is called for every node, after Self::convert_witness or Self::prune_case, if either is applicable. Read more
Source§

fn visit_node(&mut self, _data: &PostOrderIterItem<&Node<N>>)

This method is called on every node, to inform the Converter about the state of the iterator. Read more
Source§

fn prune_case( &mut self, _data: &PostOrderIterItem<&Node<N>>, _left: &Arc<Node<M>>, _right: &Arc<Node<M>>, ) -> Result<Hide, Self::Error>

For case nodes, this method is called first to decide which, if any, children to prune. Read more

Auto Trait Implementations§

§

impl<W> Freeze for SimpleFinalizer<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for SimpleFinalizer<W>
where W: RefUnwindSafe,

§

impl<W> Send for SimpleFinalizer<W>
where W: Send,

§

impl<W> Sync for SimpleFinalizer<W>
where W: Sync,

§

impl<W> Unpin for SimpleFinalizer<W>
where W: Unpin,

§

impl<W> UnwindSafe for SimpleFinalizer<W>
where W: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V