pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("State unavailable at block {0}")]
StateUnavailable(String),
#[error("Missing intermediate")]
NoIntermediate,
#[error("Invalid intermediate")]
InvalidIntermediate,
#[error("Message signature {0:?} by {1:?} is invalid")]
InvalidSignature(Vec<u8>, Vec<u8>),
#[error("Current state of blockchain has invalid authorities set")]
InvalidAuthoritiesSet,
#[error("Invalid justification")]
InvalidJustification,
#[error("Import failed with outdated justification")]
OutdatedJustification,
#[error("Import failed: {0}")]
ClientImport(String),
#[error("Chain lookup failed: {0}")]
ChainLookup(String),
#[error("Failed to sign: {0}")]
CannotSign(String),
#[error(transparent)]
Other(#[from] Box<dyn std::error::Error + Sync + Send + 'static>),
}