Skip to content

Commit

Permalink
imp: implement Infallible for ClientError
Browse files Browse the repository at this point in the history
  • Loading branch information
Farhad-Shabani committed Oct 16, 2024
1 parent e50ae6c commit cdad347
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ibc-core/ics02-client/types/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Defines the client error type
use core::convert::Infallible;

use displaydoc::Display;
use ibc_core_commitment_types::error::CommitmentError;
use ibc_core_host_types::error::{DecodingError, HostError, IdentifierError};
Expand Down Expand Up @@ -88,6 +90,12 @@ impl From<TimestampError> for ClientError {
}
}

impl From<Infallible> for ClientError {
fn from(value: Infallible) -> Self {
match value {}
}
}

#[cfg(feature = "std")]
impl std::error::Error for ClientError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
Expand Down
6 changes: 6 additions & 0 deletions ibc-core/ics24-host/types/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ impl From<ProtoError> for DecodingError {
}
}

impl From<ProstError> for DecodingError {
fn from(e: ProstError) -> Self {
Self::Prost(e)
}

Check warning on line 131 in ibc-core/ics24-host/types/src/error.rs

View check run for this annotation

Codecov / codecov/patch

ibc-core/ics24-host/types/src/error.rs#L129-L131

Added lines #L129 - L131 were not covered by tests
}

impl From<Base64Error> for DecodingError {
fn from(e: Base64Error) -> Self {
Self::Base64(e)
Expand Down

0 comments on commit cdad347

Please sign in to comment.