Skip to main content

Error

Enum Error 

Source
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

§alias: &'static str

The short alias, ltc or vtc.

§label: &'static str

The human label from the table.

§

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

§height: u32

The height the block claimed.

§rules: Vec<String>

The rule ids whose check returned false.

§

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.

Fields

§found: String

The hash of block 0 as read.

§expected: String

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 Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.