substrate_relay_helper/
error.rs1use relay_substrate_client as client;
20use sp_consensus_grandpa::AuthorityList;
21use sp_runtime::traits::MaybeDisplay;
22use std::fmt::Debug;
23use thiserror::Error;
24
25#[derive(Error, Debug)]
27pub enum Error<Hash: Debug + MaybeDisplay, HeaderNumber: Debug + MaybeDisplay> {
28 #[error("Failed to submit {0} transaction: {1:?}")]
30 SubmitTransaction(&'static str, client::Error),
31 #[error("Failed to subscribe to {0} justifications: {1:?}")]
33 Subscribe(&'static str, client::Error),
34 #[error("Failed to read {0} justification from the stream: {1}")]
36 ReadJustification(&'static str, client::Error),
37 #[error("Failed to read {0} justification from the stream: stream has ended unexpectedly")]
39 ReadJustificationStreamEnded(&'static str),
40 #[error("Failed to decode {0} justification: {1:?}")]
42 DecodeJustification(&'static str, codec::Error),
43 #[error("Read invalid {0} authorities set: {1:?}")]
45 ReadInvalidAuthorities(&'static str, AuthorityList),
46 #[error("Failed to guess initial {0} GRANDPA authorities set id: checked all possible ids in range [0; {1}]")]
48 GuessInitialAuthorities(&'static str, HeaderNumber),
49 #[error("Failed to retrieve {0} GRANDPA authorities set at header {1}: {2:?}")]
51 RetrieveAuthorities(&'static str, Hash, client::Error),
52 #[error("Failed to decode {0} GRANDPA authorities set at header {1}: {2:?}")]
54 DecodeAuthorities(&'static str, Hash, codec::Error),
55 #[error("Failed to retrieve {0} header with hash {1}: {2:?}")]
57 RetrieveHeader(&'static str, Hash, client::Error),
58 #[error(
60 "Failed to retrieve `is_initialized` flag of the with-{0} finality pallet at {1}: {2:?}"
61 )]
62 IsInitializedRetrieve(&'static str, &'static str, client::Error),
63}