mithril_stm/protocol/
error.rs1use crate::{RegistrationEntry, VerificationKeyForConcatenation};
2
3#[cfg(feature = "future_snark")]
4use crate::VerificationKeyForSnark;
5
6#[derive(Debug, Clone, thiserror::Error, PartialEq, Eq)]
8pub enum RegisterError {
9 #[error("This key has already been registered.")]
11 EntryAlreadyRegistered(Box<RegistrationEntry>),
12
13 #[error("Cannot register if the registration is closed.")]
15 RegistrationClosed,
16
17 #[error("Registration is not closed. Cannot create a signer")]
19 RegistrationIsNotClosed,
20
21 #[error("The verification of correctness of the supplied concatenation key is invalid.")]
23 ConcatenationKeyInvalid(Box<VerificationKeyForConcatenation>),
24
25 #[cfg(feature = "future_snark")]
26 #[error("The verification of correctness of the supplied SNARK key is invalid.")]
28 SnarkKeyInvalid(Box<VerificationKeyForSnark>),
29
30 #[error("Serialization error")]
32 SerializationError,
33
34 #[error("Initializer not registered. Cannot participate as a signer.")]
36 UnregisteredInitializer,
37
38 #[error("No registration found for the given index.")]
40 UnregisteredIndex,
41
42 #[cfg(feature = "future_snark")]
43 #[error("The verification key for snark is undefined.")]
45 SnarkKeyUndefined,
46
47 #[cfg(feature = "future_snark")]
48 #[error("The lottery target value is undefined.")]
50 LotteryTargetValueUndefined,
51}