pub struct Spend { /* private fields */ }Expand description
The Bitcoin script interpreter.
Evaluates an unlocking script followed by a locking script, producing a boolean result indicating whether the spend is valid.
Implementations§
Source§impl Spend
impl Spend
Sourcepub fn new(params: SpendParams) -> Self
pub fn new(params: SpendParams) -> Self
Create a new Spend interpreter from the given parameters.
Sourcepub fn validate(&mut self) -> Result<bool, ScriptError>
pub fn validate(&mut self) -> Result<bool, ScriptError>
Run full script evaluation: unlocking then locking.
Returns true if the spend is valid (top of stack is truthy after evaluation).
Sourcepub fn step(&mut self) -> Result<bool, ScriptError>
pub fn step(&mut self) -> Result<bool, ScriptError>
Execute a single script chunk.
Returns true if the current script phase is complete, false if more chunks remain.
Sourcepub fn is_relaxed(&self) -> bool
pub fn is_relaxed(&self) -> bool
Whether the interpreter is in relaxed mode.
Relaxed mode is active when transaction_version > 1 or explicitly overridden. In relaxed mode: clean stack, minimal encoding, NULLDUMMY, low-S, and push-only checks are not enforced.
Sourcepub fn set_relaxed_override(&mut self, v: bool)
pub fn set_relaxed_override(&mut self, v: bool)
Override the relaxed mode flag.
Auto Trait Implementations§
impl Freeze for Spend
impl RefUnwindSafe for Spend
impl Send for Spend
impl Sync for Spend
impl Unpin for Spend
impl UnsafeUnpin for Spend
impl UnwindSafe for Spend
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