#[non_exhaustive]pub enum Error {
Show 28 variants
InvalidPQKey,
InvalidPQSignature,
InvalidPrivateKey,
InvalidPublicKey,
InvalidMnemonic,
AddressLength,
AddressPrefix,
AddressPayload,
AddressChecksum,
InvalidSignature,
MissingChainId,
NoInputs,
NoOutputs,
DataTooLarge(usize),
MissingScript(usize),
InvalidScript(usize),
InvalidCondition(String),
InvalidSwap(String),
ZeroValue(usize),
FromMismatch,
UnknownScheme,
UnsupportedVersion(u32),
InsufficientFunds {
need: u64,
have: u64,
},
TooManyInputs(usize),
AmountOverflow,
InvalidAmount,
InvalidNetwork,
Json(String),
}Expand description
Everything that can go wrong. Messages match the node’s error text where the node has an equivalent check.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidPQKey
ML-DSA-65 key material has an invalid length or encoding.
InvalidPQSignature
ML-DSA-65 signature has an invalid length or encoding.
InvalidPrivateKey
Not a valid secp256k1 private key.
InvalidPublicKey
Public key is not 32 bytes or not a valid curve point.
InvalidMnemonic
Recovery phrase is not a valid 24-word BIP39 phrase for a valid key.
AddressLength
Address has the wrong length.
AddressPrefix
Address does not start with bt1.
AddressPayload
Address payload is not hex.
AddressChecksum
Address checksum does not match.
InvalidSignature
Signature is malformed or does not verify.
MissingChainId
Transaction has no chain ID.
NoInputs
UTXO transaction has no inputs.
NoOutputs
UTXO transaction has no outputs.
DataTooLarge(usize)
Data payload is larger than tx::MAX_DATA_SIZE.
MissingScript(usize)
Output has no script.
InvalidScript(usize)
Output script fails canonicalization.
InvalidCondition(String)
Spending condition is malformed or exceeds consensus limits.
InvalidSwap(String)
Atomic swap parameters are unsafe or invalid.
ZeroValue(usize)
Output value is zero.
FromMismatch
from is not the address of the public key.
UnknownScheme
Signature scheme is not supported.
UnsupportedVersion(u32)
Transaction version is not 0, 2 or 3.
InsufficientFunds
Spendable UTXOs do not cover amount + fee.
TooManyInputs(usize)
Covering the amount would need more than tx::MAX_INPUTS inputs.
AmountOverflow
Arithmetic overflow on amounts.
InvalidAmount
Amount string could not be parsed.
InvalidNetwork
Network name is not supported.
Json(String)
Wire JSON could not be decoded.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()