arc_malachitebft_core_driver/
error.rs1use derive_where::derive_where;
2
3use malachitebft_core_types::{Context, Round, Value};
4
5#[derive_where(Clone, Debug, PartialEq, Eq)]
7#[derive(thiserror::Error)]
8pub enum Error<Ctx>
9where
10 Ctx: Context,
11{
12 #[error("No proposer set for height {0} at round {1}")]
14 NoProposer(Ctx::Height, Round),
15
16 #[error("Proposer not found: {0}")]
18 ProposerNotFound(Ctx::Address),
19
20 #[error("Validator not found: {0}")]
22 ValidatorNotFound(Ctx::Address),
23
24 #[error("Received proposal for height {proposal_height} different from consensus height {consensus_height}")]
26 InvalidProposalHeight {
27 proposal_height: Ctx::Height,
29 consensus_height: Ctx::Height,
31 },
32
33 #[error(
35 "Received vote for height {vote_height} different from consensus height {consensus_height}"
36 )]
37 InvalidVoteHeight {
38 vote_height: Ctx::Height,
40 consensus_height: Ctx::Height,
42 },
43
44 #[error("Received certificate for height {certificate_height} different from consensus height {consensus_height}")]
46 InvalidCertificateHeight {
47 certificate_height: Ctx::Height,
49 consensus_height: Ctx::Height,
51 },
52
53 #[error("Commit certificate not found for round {round} and value {value_id}")]
55 CertificateNotFound {
56 round: Round,
58 value_id: <Ctx::Value as Value>::Id,
60 },
61}