Skip to content

Commit

Permalink
Remove Deserialize from IbcEvent (#2482)
Browse files Browse the repository at this point in the history
* Remove deserialize

* changelog
  • Loading branch information
plafer authored Jul 29, 2022
1 parent 76d7551 commit f1d51d1
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Remove Deserialize from IbcEvent and variants ([#2481])

[#2481]: https://github.com/informalsystems/ibc-rs/issues/2481
10 changes: 5 additions & 5 deletions modules/src/core/ics02_client/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub const HEADER_ATTRIBUTE_KEY: &str = "header";

/// NewBlock event signals the committing & execution of a new block.
// TODO - find a better place for NewBlock
#[derive(Debug, Deserialize, Serialize, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, Copy, PartialEq, Eq)]
pub struct NewBlock {
pub height: Height,
}
Expand Down Expand Up @@ -111,7 +111,7 @@ impl core::fmt::Display for Attributes {
}

/// CreateClient event signals the creation of a new on-chain client (IBC client).
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct CreateClient(pub Attributes);

impl CreateClient {
Expand Down Expand Up @@ -155,7 +155,7 @@ impl core::fmt::Display for CreateClient {
}

/// UpdateClient event signals a recent update of an on-chain client (IBC Client).
#[derive(Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Serialize, Clone, PartialEq, Eq)]
pub struct UpdateClient {
pub common: Attributes,
pub header: Option<AnyHeader>,
Expand Down Expand Up @@ -229,7 +229,7 @@ impl core::fmt::Debug for UpdateClient {

/// ClientMisbehaviour event signals the update of an on-chain client (IBC Client) with evidence of
/// misbehaviour.
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct ClientMisbehaviour(pub Attributes);

impl ClientMisbehaviour {
Expand Down Expand Up @@ -267,7 +267,7 @@ impl From<ClientMisbehaviour> for AbciEvent {
}

/// Signals a recent upgrade of an on-chain client (IBC Client).
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize)]
pub struct UpgradeClient(pub Attributes);

impl UpgradeClient {
Expand Down
8 changes: 4 additions & 4 deletions modules/src/core/ics03_connection/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl From<Attributes> for Vec<Tag> {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct OpenInit(Attributes);

impl OpenInit {
Expand Down Expand Up @@ -121,7 +121,7 @@ impl From<OpenInit> for AbciEvent {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct OpenTry(Attributes);

impl OpenTry {
Expand Down Expand Up @@ -161,7 +161,7 @@ impl From<OpenTry> for AbciEvent {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct OpenAck(Attributes);

impl OpenAck {
Expand Down Expand Up @@ -201,7 +201,7 @@ impl From<OpenAck> for AbciEvent {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct OpenConfirm(Attributes);

impl OpenConfirm {
Expand Down
24 changes: 12 additions & 12 deletions modules/src/core/ics04_channel/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub trait EventType {
fn event_type() -> IbcEventType;
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct OpenInit {
pub height: Height,
pub port_id: PortId,
Expand Down Expand Up @@ -233,7 +233,7 @@ impl EventType for OpenInit {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct OpenTry {
pub height: Height,
pub port_id: PortId,
Expand Down Expand Up @@ -282,7 +282,7 @@ impl EventType for OpenTry {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct OpenAck {
pub height: Height,
pub port_id: PortId,
Expand Down Expand Up @@ -336,7 +336,7 @@ impl EventType for OpenAck {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct OpenConfirm {
pub height: Height,
pub port_id: PortId,
Expand Down Expand Up @@ -386,7 +386,7 @@ impl EventType for OpenConfirm {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct CloseInit {
pub height: Height,
pub port_id: PortId,
Expand Down Expand Up @@ -477,7 +477,7 @@ impl EventType for CloseInit {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct CloseConfirm {
pub height: Height,
pub channel_id: Option<ChannelId>,
Expand Down Expand Up @@ -569,7 +569,7 @@ impl_from_ibc_to_abci_event!(
CloseConfirm
);

#[derive(Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Serialize, Clone, PartialEq, Eq)]
pub struct SendPacket {
pub height: Height,
pub packet: Packet,
Expand Down Expand Up @@ -626,7 +626,7 @@ impl core::fmt::Debug for SendPacket {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct ReceivePacket {
pub height: Height,
pub packet: Packet,
Expand Down Expand Up @@ -677,7 +677,7 @@ impl core::fmt::Display for ReceivePacket {
}
}

#[derive(Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Serialize, Clone, PartialEq, Eq)]
pub struct WriteAcknowledgement {
pub height: Height,
pub packet: Packet,
Expand Down Expand Up @@ -752,7 +752,7 @@ impl core::fmt::Debug for WriteAcknowledgement {
}
}

#[derive(Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Serialize, Clone, PartialEq, Eq)]
pub struct AcknowledgePacket {
pub height: Height,
pub packet: Packet,
Expand Down Expand Up @@ -803,7 +803,7 @@ impl core::fmt::Debug for AcknowledgePacket {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct TimeoutPacket {
pub height: Height,
pub packet: Packet,
Expand Down Expand Up @@ -854,7 +854,7 @@ impl core::fmt::Display for TimeoutPacket {
}
}

#[derive(Debug, Deserialize, Serialize, Clone, PartialEq, Eq)]
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
pub struct TimeoutOnClosePacket {
pub height: Height,
pub packet: Packet,
Expand Down
4 changes: 2 additions & 2 deletions modules/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl FromStr for IbcEventType {
}

/// Events created by the IBC component of a chain, destined for a relayer.
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
#[derive(Debug, Clone, Serialize, PartialEq, Eq)]
pub enum IbcEvent {
NewBlock(NewBlock),

Expand Down Expand Up @@ -457,7 +457,7 @@ impl IbcEvent {
}
}

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
#[derive(Debug, Clone, Serialize, PartialEq, Eq)]
pub struct ModuleEvent {
pub kind: String,
pub module_name: ModuleId,
Expand Down

0 comments on commit f1d51d1

Please sign in to comment.