pub enum Error {
Show 17 variants
UnknownParent(String),
ReservedParent {
alias: &'static str,
label: &'static str,
},
UnsupportedFamily(Family),
Document(String),
Json(Error),
Encoding(String),
CoinbaseHeight(String),
Rejected {
height: u32,
rules: Vec<String>,
},
Chain(String),
GenesisMismatch {
found: String,
expected: String,
},
Transaction(String),
Block(String),
Federation(String),
Parent(String),
Secp(Error),
Io(Error),
BlockFile(String),
}Expand description
Everything that can go wrong, from a document that names a parent this validator does not carry to a block the rules refuse.
Variants§
UnknownParent(String)
The document names a parent alias that is not in the SPEC 3.2 table.
ReservedParent
The alias is in the table but reserved: no validator carries its rules.
Fields
UnsupportedFamily(Family)
The document’s parent hands down a header family other than the one
this state or chain is instantiated for (SPEC 3): a State over
Stock refuses a txbt4 document, a StateOf<Blake2bV2> a tbtc4 one.
Document(String)
The chain document is malformed or names something this validator lacks.
Json(Error)
JSON that does not parse or does not fit the document shape.
Encoding(String)
Bytes that do not decode as a block, transaction or hex.
CoinbaseHeight(String)
A coinbase whose scriptSig does not start with a BIP 34 height push.
Rejected
A block the rules refused; rules lists the failed rule ids in order.
Fields
Chain(String)
A block that does not follow the tip, or whose hash is not the expected one.
GenesisMismatch
The block file’s block 0 does not hash to the document’s genesisHash.
Transaction(String)
A transaction the producer’s mempool policy or the rules refused.
Block(String)
Building or signing a block failed (no commitment output, a solution too long for one push, a key that is not the challenge’s).
Federation(String)
A federation that cannot be built or used: signers out of range, a
duplicate signer, too few signatures, a key that is not a signer, or
produce() on a chain whose blocks come from a round.
Parent(String)
The parent view: a node that cannot be reached or answers badly, a cookie the node refuses, a script with no parent address, a checkpoint over the data limit.
Secp(Error)
A secp256k1 failure: a bad key, a message that is not 32 bytes.
Io(Error)
Filesystem trouble reading or writing the block file (feature std).
BlockFile(String)
The block file and its index disagree: an index entry that runs past
the end of blocks.dat, or a record whose [u32 height][u32 size]
prefix is not what the index entry says. Not gated on std: a
mirror’s bytes are read the same way in a browser
(crate::mirror) as the file is on disk.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()