use crate::prelude::*;
use displaydoc::Display;
use ibc::core::ics02_client::error::ClientError;
use ibc::core::ics03_connection::error::ConnectionError;
use ibc::core::ics04_channel::error::ChannelError;
use ibc::core::timestamp::ParseTimestampError;
#[derive(Debug, Display)]
pub enum Error {
Decode(prost::DecodeError),
EmptyConsensusStatePublicKey,
InvalidHeight(ClientError),
InvalidRawClientId { client_id: String },
UnknownDataType(i32),
ParseTimeError(ParseTimestampError),
ChannelError(ChannelError),
ClientError(ClientError),
ConnectionError(ConnectionError),
TimeStampIsEmpty,
DriversifierContainOnlySpaces,
PublicKeyParseFailed(crate::cosmos::error::Error),
PublicKeyIsEmpty,
ConsensusStateIsEmpty,
SignatureAndDataIsEmpty,
SequenceCannotZero,
ProofCannotEmpty,
ChannelEndIsEmpty,
ClientStateIsEmpty,
ConnectionEndIsEmpty,
Other(String),
}
impl From<Error> for ClientError {
fn from(e: Error) -> Self {
Self::ClientSpecific {
description: e.to_string(),
}
}
}
pub(crate) trait IntoResult<T, E> {
fn into_result(self) -> Result<T, E>;
}