pub enum Error {
Show 38 variants InvalidOpcode(All), NonMinimalVerify(Token), InvalidPush(Vec<u8>), Psbt(Error), Script(Error), CmsTooManyKeys(u32), Unprintable(u8), ExpectedChar(char), UnexpectedStart, Unexpected(String), MultiColon(String), MultiAt(String), AtOutsideOr(String), NonCanonicalTrue, NonCanonicalFalse, LikelyFalse, UnknownWrapper(char), NonTopLevel(String), Trailing(String), BadPubkey(Error), MissingHash(Hash), MissingSig(PublicKey), RelativeLocktimeNotMet(u32), AbsoluteLocktimeNotMet(u32), CouldNotSatisfy, TypeCheck(String), BadDescriptor, Secp(Error), PolicyError(PolicyError), InterpreterError(InterpreterError), ContextError(ScriptContextError), BadScriptSig, NonEmptyWitness, NonEmptyScriptSig, IncorrectPubkeyHash, IncorrectScriptHash, MaxRecursiveDepthExceeded, ScriptSizeTooLarge,
}
Expand description

Miniscript

Variants

InvalidOpcode(All)

Opcode appeared which is not part of the script subset

NonMinimalVerify(Token)

Some opcode occurred followed by OP_VERIFY when it had a VERIFY version that should have been used instead

InvalidPush(Vec<u8>)

Push was illegal in some context

Psbt(Error)

PSBT-related error

Script(Error)

rust-bitcoin script error

CmsTooManyKeys(u32)

A CHECKMULTISIG opcode was preceded by a number > 20

Unprintable(u8)

Encountered unprintable character in descriptor

ExpectedChar(char)

expected character while parsing descriptor; didn’t find one

UnexpectedStart

While parsing backward, hit beginning of script

Unexpected(String)

Got something we were not expecting

MultiColon(String)

Name of a fragment contained : multiple times

MultiAt(String)

Name of a fragment contained @ multiple times

AtOutsideOr(String)

Name of a fragment contained @ but we were not parsing an OR

NonCanonicalTrue

Fragment was an and_v(_, true) which should be written as t:

NonCanonicalFalse

Fragment was an or_i(_, false) or or_i(false,_) which should be written as u: or l:

LikelyFalse

Encountered a l:0 which is syntactically equal to u:0 except stupid

UnknownWrapper(char)

Encountered a wrapping character that we don’t recognize

NonTopLevel(String)

Parsed a miniscript and the result was not of type T

Trailing(String)

Parsed a miniscript but there were more script opcodes after it

BadPubkey(Error)

Failed to parse a push as a public key

MissingHash(Hash)

Could not satisfy a script (fragment) because of a missing hash preimage

MissingSig(PublicKey)

Could not satisfy a script (fragment) because of a missing signature

RelativeLocktimeNotMet(u32)

Could not satisfy, relative locktime not met

AbsoluteLocktimeNotMet(u32)

Could not satisfy, absolute locktime not met

CouldNotSatisfy

General failure to satisfy

TypeCheck(String)

Typechecking failed

BadDescriptor

General error in creating descriptor

Secp(Error)

Forward-secp related errors

PolicyError(PolicyError)

Errors related to policy

InterpreterError(InterpreterError)

Interpreter related errors

ContextError(ScriptContextError)

Forward script context related errors

BadScriptSig

Bad Script Sig. As per standardness rules, only pushes are allowed in scriptSig. This error is invoked when op_codes are pushed onto the stack As per the current implementation, pushing an integer apart from 0 or 1 will also trigger this. This is because, Miniscript only expects push bytes for pk, sig, preimage etc or 1 or 0 for StackElement::Satisfied or StackElement::Dissatisfied

NonEmptyWitness

Witness must be empty for pre-segwit transactions

NonEmptyScriptSig

ScriptSig must be empty for pure segwit transactions

IncorrectPubkeyHash

Incorrect Script pubkey Hash for the descriptor. This is used for both PkH and Wpkh descriptors

IncorrectScriptHash

Incorrect Script pubkey Hash for the descriptor. This is used for both Sh and Wsh descriptors

MaxRecursiveDepthExceeded

Recursion depth exceeded when parsing policy/miniscript from string

ScriptSizeTooLarge

Script size too large

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.