mithril_stm/protocol/aggregate_signature/
error.rs

1use super::AggregateSignatureType;
2
3/// Error types for aggregation.
4#[derive(Debug, Clone, thiserror::Error)]
5pub enum AggregationError {
6    /// Not enough signatures were collected, got this many instead.
7    #[error("Not enough signatures. Got only {0} out of {1}.")]
8    NotEnoughSignatures(u64, u64),
9
10    #[error("Unsupported proof system: {0}")]
11    UnsupportedProofSystem(AggregateSignatureType),
12
13    /// There is a duplicate index
14    #[error("Indices are not unique.")]
15    IndexNotUnique,
16}
17
18/// Errors which can be output by Mithril aggregate verification.
19#[derive(Debug, Clone, thiserror::Error)]
20pub enum AggregateSignatureError {
21    /// This error occurs when the serialization of the raw bytes failed
22    #[error("Invalid bytes")]
23    SerializationError,
24
25    /// Batch verification of STM aggregate signatures failed
26    #[error("Batch verification of STM aggregate signatures failed")]
27    BatchInvalid,
28
29    /// The proof system used in the aggregate signature is not supported
30    #[error("Unsupported proof system: {0}")]
31    UnsupportedProofSystem(AggregateSignatureType),
32}