Skip to content

Commit

Permalink
Harry/rly tx channel (#1183)
Browse files Browse the repository at this point in the history
* made a new method "logChannelOpenMessage" to log the newly opened channel into info level

* added fields

* some changes

---------

Co-authored-by: Harry <harrycosmos@Harrys-MacBook-Pro.local>
  • Loading branch information
Cosmos-Harry and Harry authored May 12, 2023
1 parent 04e7f3a commit 45f478b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions relayer/chains/cosmos/message_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 45f478b

Please sign in to comment.