diff --git a/ibc-apps/ics20-transfer/types/src/error.rs b/ibc-apps/ics20-transfer/types/src/error.rs index 291a12635..ff50b055c 100644 --- a/ibc-apps/ics20-transfer/types/src/error.rs +++ b/ibc-apps/ics20-transfer/types/src/error.rs @@ -2,13 +2,14 @@ use core::convert::Infallible; use displaydoc::Display; +use uint::FromDecStrErr; + use ibc_core::channel::types::acknowledgement::StatusValue; use ibc_core::channel::types::channel::Order; use ibc_core::handler::types::error::ContextError; use ibc_core::host::types::error::{DecodingError, IdentifierError}; use ibc_core::host::types::identifiers::{ChannelId, PortId}; use ibc_core::primitives::prelude::*; -use uint::FromDecStrErr; #[derive(Display, Debug)] pub enum TokenTransferError { diff --git a/ibc-apps/ics721-nft-transfer/types/src/error.rs b/ibc-apps/ics721-nft-transfer/types/src/error.rs index c04b391b6..281450111 100644 --- a/ibc-apps/ics721-nft-transfer/types/src/error.rs +++ b/ibc-apps/ics721-nft-transfer/types/src/error.rs @@ -3,6 +3,7 @@ use core::convert::Infallible; use displaydoc::Display; use http::uri::InvalidUri; + use ibc_core::channel::types::acknowledgement::StatusValue; use ibc_core::channel::types::channel::Order; use ibc_core::handler::types::error::ContextError; @@ -10,7 +11,7 @@ use ibc_core::host::types::error::{DecodingError, IdentifierError}; use ibc_core::host::types::identifiers::{ChannelId, PortId}; use ibc_core::primitives::prelude::*; -#[derive(Display, Debug)] +#[derive(Display, Debug, derive_more::From)] pub enum NftTransferError { /// context error: `{0}` ContextError(ContextError), @@ -64,24 +65,6 @@ impl From for NftTransferError { } } -impl From for NftTransferError { - fn from(e: ContextError) -> Self { - Self::ContextError(e) - } -} - -impl From for NftTransferError { - fn from(e: IdentifierError) -> Self { - Self::Identifier(e) - } -} - -impl From for NftTransferError { - fn from(e: DecodingError) -> Self { - Self::Decoding(e) - } -} - impl From for StatusValue { fn from(e: NftTransferError) -> Self { StatusValue::new(e.to_string()).expect("error message must not be empty")