From 45f478b597d09eff8a1b6d6327a65628f44a9747 Mon Sep 17 00:00:00 2001 From: Cosmos-Harry <110472914+Cosmos-Harry@users.noreply.github.com> Date: Fri, 12 May 2023 12:33:08 -0400 Subject: [PATCH] Harry/rly tx channel (#1183) * made a new method "logChannelOpenMessage" to log the newly opened channel into info level * added fields * some changes --------- Co-authored-by: Harry --- relayer/chains/cosmos/message_handlers.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/relayer/chains/cosmos/message_handlers.go b/relayer/chains/cosmos/message_handlers.go index f9a9bd0f9..1e6a811c0 100644 --- a/relayer/chains/cosmos/message_handlers.go +++ b/relayer/chains/cosmos/message_handlers.go @@ -86,6 +86,7 @@ func (ccp *CosmosChainProcessor) handleChannelMessage(eventType string, ci provi ccp.channelStateCache[channelKey] = false case chantypes.EventTypeChannelOpenAck, chantypes.EventTypeChannelOpenConfirm: ccp.channelStateCache[channelKey] = true + ccp.logChannelOpenMessage(eventType, ci) case chantypes.EventTypeChannelCloseConfirm: for k := range ccp.channelStateCache { if k.PortID == ci.PortID && k.ChannelID == ci.ChannelID { @@ -182,6 +183,16 @@ func (ccp *CosmosChainProcessor) logChannelMessage(message string, ci provider.C ) } +func (ccp *CosmosChainProcessor) logChannelOpenMessage(message string, ci provider.ChannelInfo) { + fields := []zap.Field{ + + zap.String("channel_id", ci.ChannelID), + zap.String("connection_id", ci.ConnID), + zap.String("port_id", ci.PortID), + } + ccp.log.Info("Successfully created new channel", fields...) +} + func (ccp *CosmosChainProcessor) logConnectionMessage(message string, ci provider.ConnectionInfo) { ccp.logObservedIBCMessage(message, zap.String("client_id", ci.ClientID),