Skip to content

Commit

Permalink
wip: less exploding in cosmos-sdk chian module
Browse files Browse the repository at this point in the history
  • Loading branch information
benluelo committed Sep 7, 2024
1 parent ebc8ec6 commit 3f49add
Show file tree
Hide file tree
Showing 10 changed files with 241 additions and 2,996 deletions.
460 changes: 0 additions & 460 deletions lib/block-message/src/chain/cosmos_sdk.rs

This file was deleted.

1,655 changes: 0 additions & 1,655 deletions lib/relay-message/src/chain/ethereum.rs

This file was deleted.

782 changes: 0 additions & 782 deletions lib/relay-message/src/chain/scroll.rs

This file was deleted.

17 changes: 11 additions & 6 deletions lib/unionlabs/src/ibc/core/channel/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,18 @@ impl From<Channel> for protos::ibc::core::channel::v1::Channel {
}
}

#[derive(Debug)]
#[derive(Debug, Clone, PartialEq, thiserror::Error)]
pub enum TryFromChannelError {
MissingField(MissingField),
State(UnknownEnumVariant<i32>),
Counterparty(TryFromChannelCounterpartyError),
Ordering(UnknownEnumVariant<i32>),
ConnectionHops(<ConnectionIdValidator as Validate<String>>::Error),
#[error(transparent)]
MissingField(#[from] MissingField),
#[error("invalid state")]
State(#[source] UnknownEnumVariant<i32>),
#[error("invalid counterparty")]
Counterparty(#[from] TryFromChannelCounterpartyError),
#[error("invalid ordering")]
Ordering(#[source] UnknownEnumVariant<i32>),
#[error("invalid connection_hops")]
ConnectionHops(#[from] <ConnectionIdValidator as Validate<String>>::Error),
}

impl TryFrom<protos::ibc::core::channel::v1::Channel> for Channel {
Expand Down
2 changes: 1 addition & 1 deletion lib/unionlabs/src/ibc/core/channel/counterparty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl From<Counterparty> for protos::ibc::core::channel::v1::Counterparty {
}
}

#[derive(Debug, thiserror::Error)]
#[derive(Debug, Clone, PartialEq, thiserror::Error)]
pub enum TryFromChannelCounterpartyError {
#[error("error parsing port id")]
PortId(#[source] <PortId as FromStr>::Err),
Expand Down
18 changes: 11 additions & 7 deletions lib/unionlabs/src/ibc/core/connection/connection_end.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use core::str::FromStr;

use frame_support_procedural::DebugNoBound;
use macros::model;

#[cfg(feature = "ethabi")]
Expand Down Expand Up @@ -28,13 +27,18 @@ pub struct ConnectionEnd {
pub delay_period: u64,
}

#[derive(DebugNoBound)]
#[derive(Debug, Clone, PartialEq, thiserror::Error)]
pub enum TryFromConnectionEndError {
ClientId(<ClientId as FromStr>::Err),
Version(UnknownEnumVariant<String>),
State(UnknownEnumVariant<i32>),
Counterparty(TryFromConnectionCounterpartyError),
MissingField(MissingField),
#[error(transparent)]
MissingField(#[from] MissingField),
#[error("invalid client_id")]
ClientId(#[from] <ClientId as FromStr>::Err),
#[error("invalid version")]
Version(#[from] UnknownEnumVariant<String>),
#[error("invalid state")]
State(#[from] UnknownEnumVariant<i32>),
#[error("invalid counterparty")]
Counterparty(#[from] TryFromConnectionCounterpartyError),
}

impl TryFrom<protos::ibc::core::connection::v1::ConnectionEnd> for ConnectionEnd {
Expand Down
11 changes: 7 additions & 4 deletions lib/unionlabs/src/ibc/core/connection/counterparty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ impl From<Counterparty> for protos::ibc::core::connection::v1::Counterparty {
}
}

#[derive(Debug)]
#[derive(Debug, Clone, PartialEq, thiserror::Error)]
pub enum TryFromConnectionCounterpartyError {
MissingField(MissingField),
ClientId(<ClientId as FromStr>::Err),
ConnectionId(<ConnectionId as FromStr>::Err),
#[error(transparent)]
MissingField(#[from] MissingField),
#[error("invalid client_id")]
ClientId(#[source] <ClientId as FromStr>::Err),
#[error("invalid connection_id")]
ConnectionId(#[source] <ConnectionId as FromStr>::Err),
}

impl TryFrom<protos::ibc::core::connection::v1::Counterparty> for Counterparty {
Expand Down
Loading

0 comments on commit 3f49add

Please sign in to comment.