Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/floresta-chain/src/pruned_utreexo/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ use floresta_common::impl_error_from;
use crate::prelude::*;
pub trait DatabaseError: Debug + Send + Sync + 'static {}
#[derive(Debug)]
/// This is the highest level error type in floresta-chain, returned by the [crate::ChainState] methods.
/// It represents errors encountered during blockchain validation.
pub enum BlockchainError {
BlockNotPresent,
Parsing(String),
Expand All @@ -31,13 +33,19 @@ pub enum BlockchainError {
ScriptValidationFailed(script::Error),
Io(ioError),
}

#[derive(Clone, Debug, PartialEq)]
/// Represents errors encountered during transaction validation.
pub struct TransactionError {
/// The id of the transaction that caused this error
pub txid: Txid,

/// The error we've encountered
pub error: BlockValidationErrors,
}

#[derive(Clone, Debug, PartialEq)]
/// Represents errors encountered during block validation.
pub enum BlockValidationErrors {
InvalidCoinbase(String),
UtxoNotFound(OutPoint),
Expand Down