pub struct ScriptEvaluationError {
pub message: String,
pub source_txid: String,
pub source_output_index: u32,
pub context: ExecutionContext,
pub program_counter: usize,
pub stack: Vec<Vec<u8>>,
pub alt_stack: Vec<Vec<u8>>,
pub if_stack: Vec<bool>,
pub stack_mem: usize,
pub alt_stack_mem: usize,
}Expand description
A rich error type for script evaluation failures.
Contains the full execution state at the time of failure, enabling detailed debugging and error reporting.
Fields§
§message: StringThe error message describing what went wrong.
source_txid: StringThe TXID of the source UTXO being spent (hex, display order).
source_output_index: u32The output index of the source UTXO.
context: ExecutionContextWhether the error occurred in the unlocking or locking script.
program_counter: usizeThe program counter (chunk index) when the error occurred.
stack: Vec<Vec<u8>>The state of the main stack at the time of failure.
alt_stack: Vec<Vec<u8>>The state of the alt stack at the time of failure.
if_stack: Vec<bool>The state of the if/else condition stack.
stack_mem: usizeMemory usage of the main stack in bytes.
alt_stack_mem: usizeMemory usage of the alt stack in bytes.
Implementations§
Source§impl ScriptEvaluationError
impl ScriptEvaluationError
Sourcepub fn new(
message: impl Into<String>,
source_txid: impl Into<String>,
source_output_index: u32,
context: ExecutionContext,
program_counter: usize,
stack: Vec<Vec<u8>>,
alt_stack: Vec<Vec<u8>>,
if_stack: Vec<bool>,
stack_mem: usize,
alt_stack_mem: usize,
) -> Self
pub fn new( message: impl Into<String>, source_txid: impl Into<String>, source_output_index: u32, context: ExecutionContext, program_counter: usize, stack: Vec<Vec<u8>>, alt_stack: Vec<Vec<u8>>, if_stack: Vec<bool>, stack_mem: usize, alt_stack_mem: usize, ) -> Self
Creates a new script evaluation error with the given context.
Trait Implementations§
Source§impl Clone for ScriptEvaluationError
impl Clone for ScriptEvaluationError
Source§fn clone(&self) -> ScriptEvaluationError
fn clone(&self) -> ScriptEvaluationError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScriptEvaluationError
impl Debug for ScriptEvaluationError
Source§impl Display for ScriptEvaluationError
impl Display for ScriptEvaluationError
Source§impl Error for ScriptEvaluationError
impl Error for ScriptEvaluationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ScriptEvaluationError
impl RefUnwindSafe for ScriptEvaluationError
impl Send for ScriptEvaluationError
impl Sync for ScriptEvaluationError
impl Unpin for ScriptEvaluationError
impl UnsafeUnpin for ScriptEvaluationError
impl UnwindSafe for ScriptEvaluationError
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