From d757518b72fa4bb4f861011d6d5fe170f7711630 Mon Sep 17 00:00:00 2001 From: Lavysh Alexander Date: Tue, 31 Oct 2023 19:41:40 +0300 Subject: [PATCH 1/3] added new events types --- cmd/api/docs/docs.go | 10 ++++++++-- cmd/api/docs/swagger.json | 10 ++++++++-- cmd/api/docs/swagger.yaml | 6 ++++++ internal/storage/types/event_type.go | 6 +++++- internal/storage/types/event_type_enum.go | 12 ++++++++++++ 5 files changed, 39 insertions(+), 5 deletions(-) diff --git a/cmd/api/docs/docs.go b/cmd/api/docs/docs.go index 5d68b483..b995fb22 100644 --- a/cmd/api/docs/docs.go +++ b/cmd/api/docs/docs.go @@ -2587,7 +2587,10 @@ const docTemplate = `{ "submit_proposal", "cosmos.authz.v1beta1.EventGrant", "send_packet", - "ibc_transfer" + "ibc_transfer", + "fungible_token_packet", + "acknowledge_packet", + "update_client" ], "x-enum-varnames": [ "EventTypeUnknown", @@ -2623,7 +2626,10 @@ const docTemplate = `{ "EventTypeSubmitProposal", "EventTypeCosmosauthzv1beta1EventGrant", "EventTypeSendPacket", - "EventTypeIbcTransfer" + "EventTypeIbcTransfer", + "EventTypeFungibleTokenPacket", + "EventTypeAcknowledgePacket", + "EventTypeUpdateClient" ] }, "types.MsgType": { diff --git a/cmd/api/docs/swagger.json b/cmd/api/docs/swagger.json index 89ada16d..df136cd8 100644 --- a/cmd/api/docs/swagger.json +++ b/cmd/api/docs/swagger.json @@ -2580,7 +2580,10 @@ "submit_proposal", "cosmos.authz.v1beta1.EventGrant", "send_packet", - "ibc_transfer" + "ibc_transfer", + "fungible_token_packet", + "acknowledge_packet", + "update_client" ], "x-enum-varnames": [ "EventTypeUnknown", @@ -2616,7 +2619,10 @@ "EventTypeSubmitProposal", "EventTypeCosmosauthzv1beta1EventGrant", "EventTypeSendPacket", - "EventTypeIbcTransfer" + "EventTypeIbcTransfer", + "EventTypeFungibleTokenPacket", + "EventTypeAcknowledgePacket", + "EventTypeUpdateClient" ] }, "types.MsgType": { diff --git a/cmd/api/docs/swagger.yaml b/cmd/api/docs/swagger.yaml index 818759b0..5be0e069 100644 --- a/cmd/api/docs/swagger.yaml +++ b/cmd/api/docs/swagger.yaml @@ -535,6 +535,9 @@ definitions: - cosmos.authz.v1beta1.EventGrant - send_packet - ibc_transfer + - fungible_token_packet + - acknowledge_packet + - update_client type: string x-enum-varnames: - EventTypeUnknown @@ -571,6 +574,9 @@ definitions: - EventTypeCosmosauthzv1beta1EventGrant - EventTypeSendPacket - EventTypeIbcTransfer + - EventTypeFungibleTokenPacket + - EventTypeAcknowledgePacket + - EventTypeUpdateClient types.MsgType: enum: - MsgUnknown diff --git a/internal/storage/types/event_type.go b/internal/storage/types/event_type.go index 2dc9049d..28ff0303 100644 --- a/internal/storage/types/event_type.go +++ b/internal/storage/types/event_type.go @@ -45,7 +45,11 @@ package types cosmos.authz.v1beta1.EventGrant, send_packet, - ibc_transfer + ibc_transfer, + + fungible_token_packet, + acknowledge_packet, + update_client ) */ //go:generate go-enum --marshal --sql --values diff --git a/internal/storage/types/event_type_enum.go b/internal/storage/types/event_type_enum.go index d5ce3b67..d4f508cf 100644 --- a/internal/storage/types/event_type_enum.go +++ b/internal/storage/types/event_type_enum.go @@ -81,6 +81,12 @@ const ( EventTypeSendPacket EventType = "send_packet" // EventTypeIbcTransfer is a EventType of type ibc_transfer. EventTypeIbcTransfer EventType = "ibc_transfer" + // EventTypeFungibleTokenPacket is a EventType of type fungible_token_packet. + EventTypeFungibleTokenPacket EventType = "fungible_token_packet" + // EventTypeAcknowledgePacket is a EventType of type acknowledge_packet. + EventTypeAcknowledgePacket EventType = "acknowledge_packet" + // EventTypeUpdateClient is a EventType of type update_client. + EventTypeUpdateClient EventType = "update_client" ) var ErrInvalidEventType = errors.New("not a valid EventType") @@ -122,6 +128,9 @@ func EventTypeValues() []EventType { EventTypeCosmosauthzv1beta1EventGrant, EventTypeSendPacket, EventTypeIbcTransfer, + EventTypeFungibleTokenPacket, + EventTypeAcknowledgePacket, + EventTypeUpdateClient, } } @@ -172,6 +181,9 @@ var _EventTypeValue = map[string]EventType{ "cosmos.authz.v1beta1.EventGrant": EventTypeCosmosauthzv1beta1EventGrant, "send_packet": EventTypeSendPacket, "ibc_transfer": EventTypeIbcTransfer, + "fungible_token_packet": EventTypeFungibleTokenPacket, + "acknowledge_packet": EventTypeAcknowledgePacket, + "update_client": EventTypeUpdateClient, } // ParseEventType attempts to convert a string to a EventType. From 6938a41eaeead45f5396ab901611fd6516cfc29d Mon Sep 17 00:00:00 2001 From: Lavysh Alexander Date: Tue, 31 Oct 2023 19:48:05 +0300 Subject: [PATCH 2/3] added pack of channel, connection events --- cmd/api/docs/docs.go | 20 ++++++++++++-- cmd/api/docs/swagger.json | 20 ++++++++++++-- cmd/api/docs/swagger.yaml | 16 ++++++++++++ internal/storage/types/event_type.go | 13 ++++++++- internal/storage/types/event_type_enum.go | 32 +++++++++++++++++++++++ 5 files changed, 96 insertions(+), 5 deletions(-) diff --git a/cmd/api/docs/docs.go b/cmd/api/docs/docs.go index b995fb22..514ace31 100644 --- a/cmd/api/docs/docs.go +++ b/cmd/api/docs/docs.go @@ -2590,7 +2590,15 @@ const docTemplate = `{ "ibc_transfer", "fungible_token_packet", "acknowledge_packet", - "update_client" + "create_client", + "update_client", + "connection_open_try", + "connection_open_init", + "connection_open_confirm", + "channel_open_try", + "channel_open_init", + "channel_open_confirm", + "channel_open_ack" ], "x-enum-varnames": [ "EventTypeUnknown", @@ -2629,7 +2637,15 @@ const docTemplate = `{ "EventTypeIbcTransfer", "EventTypeFungibleTokenPacket", "EventTypeAcknowledgePacket", - "EventTypeUpdateClient" + "EventTypeCreateClient", + "EventTypeUpdateClient", + "EventTypeConnectionOpenTry", + "EventTypeConnectionOpenInit", + "EventTypeConnectionOpenConfirm", + "EventTypeChannelOpenTry", + "EventTypeChannelOpenInit", + "EventTypeChannelOpenConfirm", + "EventTypeChannelOpenAck" ] }, "types.MsgType": { diff --git a/cmd/api/docs/swagger.json b/cmd/api/docs/swagger.json index df136cd8..6be2465a 100644 --- a/cmd/api/docs/swagger.json +++ b/cmd/api/docs/swagger.json @@ -2583,7 +2583,15 @@ "ibc_transfer", "fungible_token_packet", "acknowledge_packet", - "update_client" + "create_client", + "update_client", + "connection_open_try", + "connection_open_init", + "connection_open_confirm", + "channel_open_try", + "channel_open_init", + "channel_open_confirm", + "channel_open_ack" ], "x-enum-varnames": [ "EventTypeUnknown", @@ -2622,7 +2630,15 @@ "EventTypeIbcTransfer", "EventTypeFungibleTokenPacket", "EventTypeAcknowledgePacket", - "EventTypeUpdateClient" + "EventTypeCreateClient", + "EventTypeUpdateClient", + "EventTypeConnectionOpenTry", + "EventTypeConnectionOpenInit", + "EventTypeConnectionOpenConfirm", + "EventTypeChannelOpenTry", + "EventTypeChannelOpenInit", + "EventTypeChannelOpenConfirm", + "EventTypeChannelOpenAck" ] }, "types.MsgType": { diff --git a/cmd/api/docs/swagger.yaml b/cmd/api/docs/swagger.yaml index 5be0e069..bf97e5d1 100644 --- a/cmd/api/docs/swagger.yaml +++ b/cmd/api/docs/swagger.yaml @@ -537,7 +537,15 @@ definitions: - ibc_transfer - fungible_token_packet - acknowledge_packet + - create_client - update_client + - connection_open_try + - connection_open_init + - connection_open_confirm + - channel_open_try + - channel_open_init + - channel_open_confirm + - channel_open_ack type: string x-enum-varnames: - EventTypeUnknown @@ -576,7 +584,15 @@ definitions: - EventTypeIbcTransfer - EventTypeFungibleTokenPacket - EventTypeAcknowledgePacket + - EventTypeCreateClient - EventTypeUpdateClient + - EventTypeConnectionOpenTry + - EventTypeConnectionOpenInit + - EventTypeConnectionOpenConfirm + - EventTypeChannelOpenTry + - EventTypeChannelOpenInit + - EventTypeChannelOpenConfirm + - EventTypeChannelOpenAck types.MsgType: enum: - MsgUnknown diff --git a/internal/storage/types/event_type.go b/internal/storage/types/event_type.go index 28ff0303..6627ccfd 100644 --- a/internal/storage/types/event_type.go +++ b/internal/storage/types/event_type.go @@ -49,7 +49,18 @@ package types fungible_token_packet, acknowledge_packet, - update_client + + create_client, + update_client, + + connection_open_try, + connection_open_init, + connection_open_confirm, + + channel_open_try, + channel_open_init, + channel_open_confirm, + channel_open_ack ) */ //go:generate go-enum --marshal --sql --values diff --git a/internal/storage/types/event_type_enum.go b/internal/storage/types/event_type_enum.go index d4f508cf..48878801 100644 --- a/internal/storage/types/event_type_enum.go +++ b/internal/storage/types/event_type_enum.go @@ -85,8 +85,24 @@ const ( EventTypeFungibleTokenPacket EventType = "fungible_token_packet" // EventTypeAcknowledgePacket is a EventType of type acknowledge_packet. EventTypeAcknowledgePacket EventType = "acknowledge_packet" + // EventTypeCreateClient is a EventType of type create_client. + EventTypeCreateClient EventType = "create_client" // EventTypeUpdateClient is a EventType of type update_client. EventTypeUpdateClient EventType = "update_client" + // EventTypeConnectionOpenTry is a EventType of type connection_open_try. + EventTypeConnectionOpenTry EventType = "connection_open_try" + // EventTypeConnectionOpenInit is a EventType of type connection_open_init. + EventTypeConnectionOpenInit EventType = "connection_open_init" + // EventTypeConnectionOpenConfirm is a EventType of type connection_open_confirm. + EventTypeConnectionOpenConfirm EventType = "connection_open_confirm" + // EventTypeChannelOpenTry is a EventType of type channel_open_try. + EventTypeChannelOpenTry EventType = "channel_open_try" + // EventTypeChannelOpenInit is a EventType of type channel_open_init. + EventTypeChannelOpenInit EventType = "channel_open_init" + // EventTypeChannelOpenConfirm is a EventType of type channel_open_confirm. + EventTypeChannelOpenConfirm EventType = "channel_open_confirm" + // EventTypeChannelOpenAck is a EventType of type channel_open_ack. + EventTypeChannelOpenAck EventType = "channel_open_ack" ) var ErrInvalidEventType = errors.New("not a valid EventType") @@ -130,7 +146,15 @@ func EventTypeValues() []EventType { EventTypeIbcTransfer, EventTypeFungibleTokenPacket, EventTypeAcknowledgePacket, + EventTypeCreateClient, EventTypeUpdateClient, + EventTypeConnectionOpenTry, + EventTypeConnectionOpenInit, + EventTypeConnectionOpenConfirm, + EventTypeChannelOpenTry, + EventTypeChannelOpenInit, + EventTypeChannelOpenConfirm, + EventTypeChannelOpenAck, } } @@ -183,7 +207,15 @@ var _EventTypeValue = map[string]EventType{ "ibc_transfer": EventTypeIbcTransfer, "fungible_token_packet": EventTypeFungibleTokenPacket, "acknowledge_packet": EventTypeAcknowledgePacket, + "create_client": EventTypeCreateClient, "update_client": EventTypeUpdateClient, + "connection_open_try": EventTypeConnectionOpenTry, + "connection_open_init": EventTypeConnectionOpenInit, + "connection_open_confirm": EventTypeConnectionOpenConfirm, + "channel_open_try": EventTypeChannelOpenTry, + "channel_open_init": EventTypeChannelOpenInit, + "channel_open_confirm": EventTypeChannelOpenConfirm, + "channel_open_ack": EventTypeChannelOpenAck, } // ParseEventType attempts to convert a string to a EventType. From 20c77911f4f2a4536602c877d63d536db30bdcbf Mon Sep 17 00:00:00 2001 From: Lavysh Alexander Date: Tue, 31 Oct 2023 19:51:21 +0300 Subject: [PATCH 3/3] added connection_open_ack event --- cmd/api/docs/docs.go | 2 ++ cmd/api/docs/swagger.json | 2 ++ cmd/api/docs/swagger.yaml | 2 ++ internal/storage/types/event_type.go | 1 + internal/storage/types/event_type_enum.go | 4 ++++ 5 files changed, 11 insertions(+) diff --git a/cmd/api/docs/docs.go b/cmd/api/docs/docs.go index 514ace31..43f742cf 100644 --- a/cmd/api/docs/docs.go +++ b/cmd/api/docs/docs.go @@ -2595,6 +2595,7 @@ const docTemplate = `{ "connection_open_try", "connection_open_init", "connection_open_confirm", + "connection_open_ack", "channel_open_try", "channel_open_init", "channel_open_confirm", @@ -2642,6 +2643,7 @@ const docTemplate = `{ "EventTypeConnectionOpenTry", "EventTypeConnectionOpenInit", "EventTypeConnectionOpenConfirm", + "EventTypeConnectionOpenAck", "EventTypeChannelOpenTry", "EventTypeChannelOpenInit", "EventTypeChannelOpenConfirm", diff --git a/cmd/api/docs/swagger.json b/cmd/api/docs/swagger.json index 6be2465a..09c096b2 100644 --- a/cmd/api/docs/swagger.json +++ b/cmd/api/docs/swagger.json @@ -2588,6 +2588,7 @@ "connection_open_try", "connection_open_init", "connection_open_confirm", + "connection_open_ack", "channel_open_try", "channel_open_init", "channel_open_confirm", @@ -2635,6 +2636,7 @@ "EventTypeConnectionOpenTry", "EventTypeConnectionOpenInit", "EventTypeConnectionOpenConfirm", + "EventTypeConnectionOpenAck", "EventTypeChannelOpenTry", "EventTypeChannelOpenInit", "EventTypeChannelOpenConfirm", diff --git a/cmd/api/docs/swagger.yaml b/cmd/api/docs/swagger.yaml index bf97e5d1..ce7a5e24 100644 --- a/cmd/api/docs/swagger.yaml +++ b/cmd/api/docs/swagger.yaml @@ -542,6 +542,7 @@ definitions: - connection_open_try - connection_open_init - connection_open_confirm + - connection_open_ack - channel_open_try - channel_open_init - channel_open_confirm @@ -589,6 +590,7 @@ definitions: - EventTypeConnectionOpenTry - EventTypeConnectionOpenInit - EventTypeConnectionOpenConfirm + - EventTypeConnectionOpenAck - EventTypeChannelOpenTry - EventTypeChannelOpenInit - EventTypeChannelOpenConfirm diff --git a/internal/storage/types/event_type.go b/internal/storage/types/event_type.go index 6627ccfd..0cba70f2 100644 --- a/internal/storage/types/event_type.go +++ b/internal/storage/types/event_type.go @@ -56,6 +56,7 @@ package types connection_open_try, connection_open_init, connection_open_confirm, + connection_open_ack, channel_open_try, channel_open_init, diff --git a/internal/storage/types/event_type_enum.go b/internal/storage/types/event_type_enum.go index 48878801..9c2fa1a8 100644 --- a/internal/storage/types/event_type_enum.go +++ b/internal/storage/types/event_type_enum.go @@ -95,6 +95,8 @@ const ( EventTypeConnectionOpenInit EventType = "connection_open_init" // EventTypeConnectionOpenConfirm is a EventType of type connection_open_confirm. EventTypeConnectionOpenConfirm EventType = "connection_open_confirm" + // EventTypeConnectionOpenAck is a EventType of type connection_open_ack. + EventTypeConnectionOpenAck EventType = "connection_open_ack" // EventTypeChannelOpenTry is a EventType of type channel_open_try. EventTypeChannelOpenTry EventType = "channel_open_try" // EventTypeChannelOpenInit is a EventType of type channel_open_init. @@ -151,6 +153,7 @@ func EventTypeValues() []EventType { EventTypeConnectionOpenTry, EventTypeConnectionOpenInit, EventTypeConnectionOpenConfirm, + EventTypeConnectionOpenAck, EventTypeChannelOpenTry, EventTypeChannelOpenInit, EventTypeChannelOpenConfirm, @@ -212,6 +215,7 @@ var _EventTypeValue = map[string]EventType{ "connection_open_try": EventTypeConnectionOpenTry, "connection_open_init": EventTypeConnectionOpenInit, "connection_open_confirm": EventTypeConnectionOpenConfirm, + "connection_open_ack": EventTypeConnectionOpenAck, "channel_open_try": EventTypeChannelOpenTry, "channel_open_init": EventTypeChannelOpenInit, "channel_open_confirm": EventTypeChannelOpenConfirm,