1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use failure::Fail;
#[derive(Clone, PartialEq, Debug, Fail)]
pub enum Error {
#[fail(display = "Number of participants must be between 1 and 256")]
InvalidNodeCount,
#[fail(display = "Instance cannot propose")]
InstanceCannotPropose,
#[fail(display = "Multiple inputs received")]
MultipleInputs,
#[fail(display = "Proof construction failed")]
ProofConstructionFailed,
#[fail(display = "Unknown sender")]
UnknownSender,
}
pub type Result<T> = ::std::result::Result<T, Error>;
#[derive(Clone, Debug, Fail, PartialEq)]
pub enum FaultKind {
#[fail(display = "`Broadcast` received a `Value` from a node other than the proposer.")]
ReceivedValueFromNonProposer,
#[fail(display = "`Broadcast` received multiple different `Value`s from the proposer.")]
MultipleValues,
#[fail(display = "`Broadcast` received multiple different `Echo`s from the same sender.")]
MultipleEchos,
#[fail(display = "`Broadcast` received multiple different `Ready`s from the same sender.")]
MultipleReadys,
#[fail(display = "`Broadcast` recevied an Echo message containing an invalid proof.")]
InvalidProof,
#[fail(display = "`Broadcast` received shards with valid proofs, that couldn't be decoded.")]
BroadcastDecoding,
}