From 2ff20390994d21652096e14592636e4bab8c8a82 Mon Sep 17 00:00:00 2001 From: iquerejeta Date: Wed, 4 Jan 2023 11:00:37 +0100 Subject: [PATCH] Batch error for aggregate signatures --- mithril-stm/src/error.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mithril-stm/src/error.rs b/mithril-stm/src/error.rs index 18219df857e..bb6fb7ce220 100644 --- a/mithril-stm/src/error.rs +++ b/mithril-stm/src/error.rs @@ -89,6 +89,10 @@ pub enum StmAggregateSignatureError { /// Invalid merkle batch path #[error("Batch path does not verify against root")] PathInvalid(BatchPath), + + /// Batch verification of STM aggregate signatures failed + #[error("Batch verification of STM aggregate signatures failed")] + BatchInvalid, } /// Error types for aggregation. @@ -154,7 +158,7 @@ impl From 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!(), } @@ -165,10 +169,10 @@ impl From 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!(), } } }