mithril_aggregator/services/signer_registration/
error.rs1use thiserror::Error;
2
3use mithril_common::{
4 entities::{Epoch, SignerWithStake},
5 StdError,
6};
7
8use mithril_common::chain_observer::ChainObserverError;
9
10#[derive(Error, Debug)]
12pub enum SignerRegistrationError {
13 #[error("a signer registration round is not opened yet, please try again later")]
15 RegistrationRoundNotYetOpened,
16
17 #[error("unexpected signer registration round epoch: current_round_epoch: {current_round_epoch}, received_epoch: {received_epoch}")]
19 RegistrationRoundUnexpectedEpoch {
20 current_round_epoch: Epoch,
22 received_epoch: Epoch,
24 },
25
26 #[error("chain observer error")]
28 ChainObserver(#[from] ChainObserverError),
29
30 #[error("signer already registered")]
32 ExistingSigner(Box<SignerWithStake>),
33
34 #[error("store error")]
36 Store(#[source] StdError),
37
38 #[error("epoch service error")]
40 EpochService(#[source] StdError),
41
42 #[error("signer registration failed")]
44 FailedSignerRegistration(#[source] StdError),
45
46 #[error("signer recorder failed: '{0}'")]
48 FailedSignerRecorder(String),
49
50 #[error("signer registration is always closed on a follower aggregator")]
52 RegistrationRoundAlwaysClosedOnFollowerAggregator,
53
54 #[error("signer synchronization is not available on a leader aggregator")]
56 SignerSynchronizationUnavailableOnLeaderAggregator,
57
58 #[error("failed fetching leader aggregator epoch settings: '{0}'")]
60 FailedFetchingLeaderAggregatorEpochSettings(#[source] StdError),
61}