Skip to content

Commit

Permalink
Remove unused error variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirko-von-Leipzig committed Nov 4, 2024
1 parent ead218d commit 827aecb
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions crates/block-producer/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,12 @@ pub enum BuildBatchError {
)]
TooManyAccountsInBatch(Vec<ProvenTransaction>),

#[error("Failed to create notes SMT: {0}")]
NotesSmtError(MerkleError, Vec<ProvenTransaction>),

#[error("Failed to get note paths: {0}")]
NotePathsError(NotePathsError, Vec<ProvenTransaction>),

#[error("Duplicated unauthenticated transaction input note ID in the batch: {0}")]
DuplicateUnauthenticatedNote(NoteId, Vec<ProvenTransaction>),

#[error("Duplicated transaction output note ID in the batch: {0}")]
DuplicateOutputNote(NoteId, Vec<ProvenTransaction>),

#[error("Unauthenticated transaction notes not found in the store: {0:?}")]
UnauthenticatedNotesNotFound(Vec<NoteId>, Vec<ProvenTransaction>),

#[error("Note hashes mismatch for note {id}: (input: {input_hash}, output: {output_hash})")]
NoteHashesMismatch {
id: NoteId,
Expand All @@ -154,24 +145,6 @@ pub enum BuildBatchError {
InjectedFailure(Vec<ProvenTransaction>),
}

impl BuildBatchError {
pub fn into_transactions(self) -> Vec<ProvenTransaction> {
match self {
BuildBatchError::TooManyInputNotes(_, txs) => txs,
BuildBatchError::TooManyNotesCreated(_, txs) => txs,
BuildBatchError::TooManyAccountsInBatch(txs) => txs,
BuildBatchError::NotesSmtError(_, txs) => txs,
BuildBatchError::NotePathsError(_, txs) => txs,
BuildBatchError::DuplicateUnauthenticatedNote(_, txs) => txs,
BuildBatchError::DuplicateOutputNote(_, txs) => txs,
BuildBatchError::UnauthenticatedNotesNotFound(_, txs) => txs,
BuildBatchError::NoteHashesMismatch { txs, .. } => txs,
BuildBatchError::AccountUpdateError { txs, .. } => txs,
BuildBatchError::InjectedFailure(txs) => txs,
}
}
}

// Block prover errors
// =================================================================================================

Expand Down Expand Up @@ -199,18 +172,6 @@ pub enum BlockInputsError {
GrpcClientError(String),
}

// Note paths errors
// =================================================================================================

#[allow(clippy::enum_variant_names)]
#[derive(Debug, PartialEq, Eq, Error)]
pub enum NotePathsError {
#[error("failed to parse protobuf message: {0}")]
ConversionError(#[from] ConversionError),
#[error("gRPC client failed with error: {0}")]
GrpcClientError(String),
}

// Block applying errors
// =================================================================================================

Expand Down

0 comments on commit 827aecb

Please sign in to comment.