Skip to content

Commit

Permalink
Batch error for aggregate signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
iquerejeta committed Jan 4, 2023
1 parent 55b4539 commit 2ff2039
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mithril-stm/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ pub enum StmAggregateSignatureError<D: Digest + FixedOutput> {
/// Invalid merkle batch path
#[error("Batch path does not verify against root")]
PathInvalid(BatchPath<D>),

/// Batch verification of STM aggregate signatures failed
#[error("Batch verification of STM aggregate signatures failed")]
BatchInvalid,
}

/// Error types for aggregation.
Expand Down Expand Up @@ -154,7 +158,7 @@ impl From<MultiSignatureError> for StmSignatureError {
match e {
MultiSignatureError::SerializationError => Self::SerializationError,
MultiSignatureError::SignatureInvalid(e) => Self::SignatureInvalid(e),
MultiSignatureError::BatchInvalid => Self::BatchInvalid,
MultiSignatureError::BatchInvalid => unreachable!(),
MultiSignatureError::KeyInvalid(_) => unreachable!(),
MultiSignatureError::AggregateSignatureInvalid => unreachable!(),
}
Expand All @@ -165,10 +169,10 @@ impl<D: Digest + FixedOutput> From<MultiSignatureError> for StmAggregateSignatur
fn from(e: MultiSignatureError) -> Self {
match e {
MultiSignatureError::AggregateSignatureInvalid => Self::AggregateSignatureInvalid,
MultiSignatureError::BatchInvalid => Self::BatchInvalid,
MultiSignatureError::SerializationError => unreachable!(),
MultiSignatureError::KeyInvalid(_) => unreachable!(),
MultiSignatureError::SignatureInvalid(_e) => unreachable!(),
MultiSignatureError::BatchInvalid => unreachable!(),
}
}
}
Expand Down

0 comments on commit 2ff2039

Please sign in to comment.