Skip to content

Commit

Permalink
fix: remove Identifier variant from few more enums
Browse files Browse the repository at this point in the history
  • Loading branch information
Farhad-Shabani committed Sep 9, 2024
1 parent d153447 commit a85d54c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 6 additions & 2 deletions ibc-apps/ics721-nft-transfer/types/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ pub enum NftTransferError {
ContextError(ContextError),
/// decoding error: `{0}`
Decoding(DecodingError),
/// identifier error: `{0}`
Identifier(IdentifierError),
/// invalid trace: `{0}`
InvalidTrace(String),
/// invalid URI error: `{0}`
Expand Down Expand Up @@ -58,6 +56,12 @@ impl std::error::Error for NftTransferError {
}
}

impl From<IdentifierError> for NftTransferError {
fn from(e: IdentifierError) -> Self {
Self::Decoding(DecodingError::Identifier(e))
}
}

impl From<Infallible> for NftTransferError {
fn from(e: Infallible) -> Self {
match e {}
Expand Down
5 changes: 1 addition & 4 deletions ibc-core/ics02-client/types/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ pub enum ClientError {
Upgrade(UpgradeClientError),
/// decoding error: `{0}`
Decoding(DecodingError),
/// identifier error: `{0}`
Identifier(IdentifierError),
/// invalid trust threshold: `{numerator}`/`{denominator}`
InvalidTrustThreshold { numerator: u64, denominator: u64 },
/// invalid client state type: `{0}`
Expand Down Expand Up @@ -110,7 +108,7 @@ impl From<DecodingError> for ClientError {

impl From<IdentifierError> for ClientError {
fn from(e: IdentifierError) -> Self {
Self::Identifier(e)
Self::Decoding(DecodingError::Identifier(e))
}
}

Expand All @@ -119,7 +117,6 @@ impl std::error::Error for ClientError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self {
Self::FailedICS23Verification(e) => Some(e),
Self::Identifier(e) => Some(e),
Self::Decoding(e) => Some(e),
_ => None,
}
Expand Down

0 comments on commit a85d54c

Please sign in to comment.