pub enum CheckBlockError<N: Network> {
BlockAlreadyExists {
hash: N::BlockHash,
},
InvalidHeight {
expected: u32,
actual: u32,
},
InvalidHash,
InvalidPrefix {
index: usize,
error: Box<CheckBlockError<N>>,
},
SolutionAlreadyExists {
solution_id: SolutionID<N>,
},
SpeculationFailed {
inner: Error,
},
VerificationFailed {
inner: Error,
},
SolutionLimitReached {
prover_address: Address<N>,
},
PreviousSolutionNotFound {
solution_id: SolutionID<N>,
},
PreviousTransactionNotFound {
transaction_id: N::TransactionID,
},
Other(Error),
}Expand description
Error returned by [Self::check_block_subdag] and [Self::check_block_subdag_inner].
This allows parsing for begning errors, such as the block already existing in the ledger.
Variants§
BlockAlreadyExists
InvalidHeight
InvalidHash
InvalidPrefix
An error related to the given prefix of pending blocks.
SolutionAlreadyExists
Fields
§
solution_id: SolutionID<N>SpeculationFailed
VerificationFailed
SolutionLimitReached
PreviousSolutionNotFound
Fields
§
solution_id: SolutionID<N>PreviousTransactionNotFound
Fields
§
transaction_id: N::TransactionIDOther(Error)
Implementations§
Source§impl<N: Network> CheckBlockError<N>
impl<N: Network> CheckBlockError<N>
pub fn into_anyhow(self) -> Error
Trait Implementations§
Source§impl<N: Network> Display for CheckBlockError<N>where
N::BlockHash: Display,
Box<CheckBlockError<N>>: Debug,
SolutionID<N>: Display,
Address<N>: Display,
N::TransactionID: Display,
impl<N: Network> Display for CheckBlockError<N>where
N::BlockHash: Display,
Box<CheckBlockError<N>>: Debug,
SolutionID<N>: Display,
Address<N>: Display,
N::TransactionID: Display,
Source§impl<N: Network> Error for CheckBlockError<N>
impl<N: Network> Error for CheckBlockError<N>
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()
Auto Trait Implementations§
impl<N> Freeze for CheckBlockError<N>where
<N as Network>::BlockHash: Freeze,
<N as Network>::TransactionID: Freeze,
<N as Environment>::Projective: Freeze,
impl<N> RefUnwindSafe for CheckBlockError<N>where
<N as Network>::BlockHash: RefUnwindSafe,
<N as Network>::TransactionID: RefUnwindSafe,
N: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
impl<N> Send for CheckBlockError<N>
impl<N> Sync for CheckBlockError<N>
impl<N> Unpin for CheckBlockError<N>where
<N as Network>::BlockHash: Unpin,
<N as Network>::TransactionID: Unpin,
N: Unpin,
<N as Environment>::Projective: Unpin,
impl<N> UnsafeUnpin for CheckBlockError<N>where
<N as Network>::BlockHash: UnsafeUnpin,
<N as Network>::TransactionID: UnsafeUnpin,
<N as Environment>::Projective: UnsafeUnpin,
impl<N> UnwindSafe for CheckBlockError<N>where
<N as Network>::BlockHash: UnwindSafe,
<N as Network>::TransactionID: UnwindSafe,
N: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.