pub enum ScriptError {
StackUnderflow,
UnexpectedEndOfScript,
InvalidPushData,
UnsupportedOpcode(u8),
VerifyFailed,
ScriptFailed,
OpReturnEncountered,
UnbalancedConditional,
InvalidHex,
}Expand description
All error conditions that can arise during script parsing or execution.
Variants§
StackUnderflow
Stack had fewer elements than the operation required.
UnexpectedEndOfScript
Script byte stream ended mid-instruction.
InvalidPushData
A push-data length field is malformed or exceeds remaining bytes.
UnsupportedOpcode(u8)
An opcode byte is valid in Bitcoin but not implemented by this engine.
VerifyFailed
OP_VERIFY, OP_EQUALVERIFY, or OP_CHECKSIGVERIFY consumed a false value.
ScriptFailed
Execution completed but the stack is empty or the top element is false.
OpReturnEncountered
OP_RETURN was encountered. The script is provably unspendable.
UnbalancedConditional
OP_IF / OP_NOTIF / OP_ELSE / OP_ENDIF are not properly balanced.
InvalidHex
A hex string could not be decoded (odd length or invalid character).
Trait Implementations§
Source§impl Clone for ScriptError
impl Clone for ScriptError
Source§fn clone(&self) -> ScriptError
fn clone(&self) -> ScriptError
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 ScriptError
impl Debug for ScriptError
Source§impl Display for ScriptError
impl Display for ScriptError
Source§impl Error for ScriptError
impl Error for ScriptError
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()
Source§impl PartialEq for ScriptError
impl PartialEq for ScriptError
impl Eq for ScriptError
impl StructuralPartialEq for ScriptError
Auto Trait Implementations§
impl Freeze for ScriptError
impl RefUnwindSafe for ScriptError
impl Send for ScriptError
impl Sync for ScriptError
impl Unpin for ScriptError
impl UnwindSafe for ScriptError
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