sc_authority_discovery/
error.rs1pub type Result<T> = std::result::Result<T, Error>;
23
24#[derive(Debug, thiserror::Error)]
26#[allow(missing_docs)]
27pub enum Error {
28 #[error("Received dht value found event with records with different keys.")]
29 ReceivingDhtValueFoundEventWithDifferentKeys,
30
31 #[error("Received dht value found event with no records.")]
32 ReceivingDhtValueFoundEventWithNoRecords,
33
34 #[error("Failed to verify a dht payload with the given signature.")]
35 VerifyingDhtPayload,
36
37 #[error("Failed to hash the authority id to be used as a dht key.")]
38 HashingAuthorityId(#[from] sc_network_types::multihash::Error),
39
40 #[error("Failed calling into the Substrate runtime: {0}")]
41 CallingRuntime(#[from] sp_blockchain::Error),
42
43 #[error("Received a dht record with a key that does not match any in-flight awaited keys.")]
44 ReceivingUnexpectedRecord,
45
46 #[error("Failed to encode a protobuf payload.")]
47 EncodingProto(#[from] prost::EncodeError),
48
49 #[error("Failed to decode a protobuf payload.")]
50 DecodingProto(#[from] prost::DecodeError),
51
52 #[error("Failed to encode or decode scale payload.")]
53 EncodingDecodingScale(#[from] codec::Error),
54
55 #[error("Failed to encode or decode AddrCache.")]
56 EncodingDecodingAddrCache(String),
57
58 #[error("Failed to parse a libp2p multi address.")]
59 ParsingMultiaddress(#[from] sc_network::multiaddr::ParseError),
60
61 #[error("Failed to parse a libp2p key: {0}")]
62 ParsingLibp2pIdentity(String),
63
64 #[error("Failed to sign: {0}.")]
65 CannotSign(String),
66
67 #[error("Failed to register Prometheus metric.")]
68 Prometheus(#[from] prometheus_endpoint::PrometheusError),
69
70 #[error("Received authority record that contains addresses with multiple peer ids")]
71 ReceivingDhtValueFoundEventWithDifferentPeerIds,
72
73 #[error("Received authority record without any addresses having a peer id")]
74 ReceivingDhtValueFoundEventWithNoPeerIds,
75
76 #[error("Received authority record without a valid signature for the remote peer id.")]
77 MissingPeerIdSignature,
78
79 #[error("Unable to fetch best block.")]
80 BestBlockFetchingError,
81
82 #[error("Publisher not present.")]
83 MissingPublisher,
84
85 #[error("Unknown authority.")]
86 UnknownAuthority,
87}