use alloc::boxed::Box; use displaydoc::Display; use tendermint::{block::Height, Hash}; use tendermint_light_client::{ builder::error::Error as TmBuilderError, errors::Error as LightClientError, }; #[derive(Debug, Display)] pub enum Error { /// empty trace EmptyTrace, /// first block in trace does not match trusted (expected {expected:?}, found {found:?}) FirstTraceBlockNotTrusted { expected: (Height, Hash), found: (Height, Hash), }, /// verification failure (`{0}`) VerificationFailure(Box), /// failed to build light client (`{0}`) LightClientBuildFailure(Box), } impl From for Error { fn from(e: LightClientError) -> Self { Error::VerificationFailure(Box::new(e)) } } impl From for Error { fn from(e: TmBuilderError) -> Self { Error::LightClientBuildFailure(Box::new(e)) } }