Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/ibc-types-core-channel/src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use ibc_types_core_connection::ConnectionId;
use crate::{ChannelError, ChannelId, PortId, Version};

#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct IdentifiedChannelEnd {
pub port_id: PortId,
pub channel_id: ChannelId,
Expand Down Expand Up @@ -72,6 +73,7 @@ impl From<IdentifiedChannelEnd> for RawIdentifiedChannel {
}

#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ChannelEnd {
pub state: State,
pub ordering: Order,
Expand Down Expand Up @@ -238,6 +240,7 @@ impl ChannelEnd {
}

#[derive(Clone, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Counterparty {
pub port_id: PortId,
pub channel_id: Option<ChannelId>,
Expand Down Expand Up @@ -320,6 +323,7 @@ impl From<Counterparty> for RawCounterparty {
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Order {
None = 0isize,
Unordered = 1isize,
Expand Down Expand Up @@ -378,6 +382,7 @@ impl FromStr for Order {
}

#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum State {
Uninitialized = 0isize,
Init = 1isize,
Expand Down
2 changes: 2 additions & 0 deletions crates/ibc-types-core-channel/src/identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use ibc_types_identifier::{
use crate::prelude::*;

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct PortId(pub String);

impl PortId {
Expand Down Expand Up @@ -57,6 +58,7 @@ impl Default for PortId {
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ChannelId(pub String);

impl ChannelId {
Expand Down
1 change: 1 addition & 0 deletions crates/ibc-types-core-channel/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use crate::prelude::*;
/// No explicit validation is necessary, and the
/// spec (v1) currently allows empty strings.
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Version(pub String);

impl Version {
Expand Down
1 change: 1 addition & 0 deletions crates/ibc-types-core-client/src/client_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use crate::{client_type::ClientType, prelude::*};
/// derived from the client type `ctype`, and a monotonically increasing
/// `counter`; these are separated by a dash "-".
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Into)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ClientId(pub(crate) String);

impl ClientId {
Expand Down
1 change: 1 addition & 0 deletions crates/ibc-types-core-client/src/height.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::error::Error;

/// An IBC height, containing a revision number (epoch) and a revision height (block height).
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Height {
/// Previously known as "epoch"
pub revision_number: u64,
Expand Down
4 changes: 4 additions & 0 deletions crates/ibc-types-core-connection/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use crate::{ConnectionError, ConnectionId, Version};

//#[derive(Clone, Debug, PartialEq, Eq, Hash)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct IdentifiedConnectionEnd {
pub connection_id: ConnectionId,
pub connection_end: ConnectionEnd,
Expand Down Expand Up @@ -93,6 +94,7 @@ impl From<IdentifiedConnectionEnd> for RawIdentifiedConnection {

//#[derive(Clone, Debug, PartialEq, Eq, Hash)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ConnectionEnd {
pub state: State,
pub client_id: ClientId,
Expand Down Expand Up @@ -190,6 +192,7 @@ impl ConnectionEnd {
}

#[derive(Clone, Debug, Default, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Counterparty {
pub client_id: ClientId,
pub connection_id: Option<ConnectionId>,
Expand Down Expand Up @@ -243,6 +246,7 @@ impl From<Counterparty> for RawCounterparty {
}

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum State {
Uninitialized = 0isize,
Init = 1isize,
Expand Down
2 changes: 2 additions & 0 deletions crates/ibc-types-core-connection/src/identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::prelude::*;
///
/// Also, contrast with tendermint-rs `ChainId` type.
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ChainId {
pub id: String,
pub version: u64,
Expand Down Expand Up @@ -159,6 +160,7 @@ impl From<String> for ChainId {
}

#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ConnectionId(pub String);

impl ConnectionId {
Expand Down
1 change: 1 addition & 0 deletions crates/ibc-types-core-connection/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::ConnectionError;

/// Stores the identifier and the features supported by a version
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Version {
/// unique version identifier
pub identifier: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use crate::{Error, TrustThreshold};
pub const TENDERMINT_CLIENT_STATE_TYPE_URL: &str = "/ibc.lightclients.tendermint.v1.ClientState";

#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ClientState {
pub chain_id: ChainId,
pub trust_level: TrustThreshold,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::error::Error;
/// This type accepts even a value of 0, (numerator = 0, denominator = 0),
/// which is used in the client state of an upgrading client.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct TrustThreshold {
pub numerator: u64,
pub denominator: u64,
Expand Down