mithril_stm/protocol/
error.rs

1use crate::signature_scheme::BlsVerificationKey;
2
3/// Errors which can be outputted by key registration.
4#[derive(Debug, Clone, thiserror::Error, PartialEq, Eq)]
5pub enum RegisterError {
6    /// This key has already been registered by a participant
7    #[error("This key has already been registered.")]
8    KeyRegistered(Box<BlsVerificationKey>),
9
10    /// Cannot register if the registration is closed.
11    #[error("Cannot register if the registration is closed.")]
12    RegistrationClosed,
13
14    /// Registration is not closed. Cannot create a signer.
15    #[error("Registration is not closed. Cannot create a signer")]
16    RegistrationIsNotClosed,
17
18    /// The supplied key is not valid
19    #[error("The verification of correctness of the supplied key is invalid.")]
20    KeyInvalid(Box<BlsVerificationKey>),
21
22    /// Serialization error
23    #[error("Serialization error")]
24    SerializationError,
25
26    /// UnregisteredInitializer error
27    #[error("Initializer not registered. Cannot participate as a signer.")]
28    UnregisteredInitializer,
29
30    /// No registration found for the given index.
31    #[error("No registration found for the given index.")]
32    UnregisteredIndex,
33}