pub struct ScriptTemplateUnlock { /* private fields */ }Expand description
Return type for template unlock methods.
Contains functions to sign a transaction input and estimate the unlocking script length.
Implementations§
Source§impl ScriptTemplateUnlock
impl ScriptTemplateUnlock
Sourcepub fn new<S, E>(sign_fn: S, estimate_length_fn: E) -> Selfwhere
S: Fn(&SigningContext<'_>) -> Result<UnlockingScript> + Send + Sync + 'static,
E: Fn() -> usize + Send + Sync + 'static,
pub fn new<S, E>(sign_fn: S, estimate_length_fn: E) -> Selfwhere
S: Fn(&SigningContext<'_>) -> Result<UnlockingScript> + Send + Sync + 'static,
E: Fn() -> usize + Send + Sync + 'static,
Creates a new ScriptTemplateUnlock.
§Arguments
sign_fn- A function that signs a transaction inputestimate_length_fn- A function that estimates the unlocking script length
Sourcepub fn sign(&self, context: &SigningContext<'_>) -> Result<UnlockingScript>
pub fn sign(&self, context: &SigningContext<'_>) -> Result<UnlockingScript>
Sourcepub fn estimate_length(&self) -> usize
pub fn estimate_length(&self) -> usize
Estimates the unlocking script length in bytes.
This is useful for fee estimation before the actual signature is created.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScriptTemplateUnlock
impl !RefUnwindSafe for ScriptTemplateUnlock
impl Send for ScriptTemplateUnlock
impl Sync for ScriptTemplateUnlock
impl Unpin for ScriptTemplateUnlock
impl UnsafeUnpin for ScriptTemplateUnlock
impl !UnwindSafe for ScriptTemplateUnlock
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