Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add From derive for ICS26 messages #938

Merged
merged 1 commit into from
Nov 2, 2023
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
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/938-add-from.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Add From implementation for ICS26 enum types to make it simpler
to construct the types. ([\#938](https://github.com/cosmos/ibc-rs/pull/938))
2 changes: 1 addition & 1 deletion crates/ibc/src/core/ics02_client/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub mod upgrade_client;
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, derive_more::From)]
pub enum ClientMsg {
CreateClient(MsgCreateClient),
UpdateClient(MsgUpdateClient),
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc/src/core/ics03_connection/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub mod conn_open_try;
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, derive_more::From)]
pub enum ConnectionMsg {
OpenInit(MsgConnectionOpenInit),
OpenTry(MsgConnectionOpenTry),
Expand Down
4 changes: 2 additions & 2 deletions crates/ibc/src/core/ics04_channel/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use crate::core::ics24_host::identifier::PortId;
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, derive_more::From)]
pub enum ChannelMsg {
OpenInit(MsgChannelOpenInit),
OpenTry(MsgChannelOpenTry),
Expand All @@ -52,7 +52,7 @@ pub enum ChannelMsg {
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, derive_more::From)]
pub enum PacketMsg {
Recv(MsgRecvPacket),
Ack(MsgAcknowledgement),
Expand Down
2 changes: 1 addition & 1 deletion crates/ibc/src/core/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub trait Msg: Clone {
derive(borsh::BorshSerialize, borsh::BorshDeserialize)
)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq, derive_more::From)]
pub enum MsgEnvelope {
Client(ClientMsg),
Connection(ConnectionMsg),
Expand Down
Loading