mithril_aggregator/services/signer_registration/
error.rs1use thiserror::Error;
2
3use mithril_common::StdError;
4use mithril_common::entities::{Epoch, PartyId, SignerWithStake};
5
6use mithril_cardano_node_chain::chain_observer::ChainObserverError;
7
8#[derive(Error, Debug)]
10pub enum SignerRegistrationError {
11 #[error("a signer registration round is not opened yet, please try again later")]
13 RegistrationRoundNotYetOpened,
14
15 #[error(
17 "unexpected signer registration round epoch: current_round_epoch: {current_round_epoch}, received_epoch: {received_epoch}"
18 )]
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 is invalid for party '{0}' and epoch {1}")]
44 InvalidSignerRegistration(PartyId, Epoch, #[source] StdError),
45
46 #[error("Recording signer registration failed for party '{0}' and epoch {1}")]
48 FailedSignerRecorder(PartyId, Epoch, #[source] StdError),
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}