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§
Trait Implementations§
Source§impl<W: Iterator<Item = Value>> Converter<Commit, Redeem> for SimpleFinalizer<W>
impl<W: Iterator<Item = Value>> Converter<Commit, Redeem> for SimpleFinalizer<W>
Source§type Error = FinalizeError
type Error = FinalizeError
The error type returned by the methods on this trait.
Source§fn convert_witness(
&mut self,
data: &PostOrderIterItem<&CommitNode>,
_: &NoWitness,
) -> Result<Value, Self::Error>
fn convert_witness( &mut self, data: &PostOrderIterItem<&CommitNode>, _: &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>,
_: Option<&Arc<RedeemNode>>,
_: &NoDisconnect,
) -> Result<Arc<RedeemNode>, Self::Error>
fn convert_disconnect( &mut self, _: &PostOrderIterItem<&CommitNode>, _: Option<&Arc<RedeemNode>>, _: &NoDisconnect, ) -> Result<Arc<RedeemNode>, 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>,
inner: Inner<&Arc<RedeemNode>, &Arc<RedeemNode>, &Value>,
) -> Result<Arc<RedeemData>, Self::Error>
fn convert_data( &mut self, data: &PostOrderIterItem<&CommitNode>, inner: Inner<&Arc<RedeemNode>, &Arc<RedeemNode>, &Value>, ) -> Result<Arc<RedeemData>, Self::Error>
This method is called for every node, after
Self::convert_witness or
Self::prune_case, if either is applicable. Read moreSource§fn visit_node(&mut self, _data: &PostOrderIterItem<&Node<N>>)
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 moreAuto 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> UnsafeUnpin for SimpleFinalizer<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for SimpleFinalizer<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more