Skip to content

Commit

Permalink
update after reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek committed Nov 10, 2022
1 parent eae920c commit 40f122b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
10 changes: 4 additions & 6 deletions x/ccv/consumer/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ func (k Keeper) OnRecvVSCPacket(ctx sdk.Context, packet channeltypes.Packet, new
// - send pending slash requests in states
k.SendPendingSlashRequests(ctx)

// emit first VSC packet to signal that CCV is working
// emit event on first VSC packet to signal that CCV is working
ctx.EventManager().EmitEvent(
sdk.NewEvent(
ccv.EventTypeFirstVSCPacket,
ccv.EventTypeChannelEstablished,
sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName),
sdk.NewAttribute(channeltypes.AttributeKeySrcChannel, packet.SourceChannel),
sdk.NewAttribute(channeltypes.AttributeKeySrcPort, packet.SourcePort),
sdk.NewAttribute(channeltypes.AttributeKeyDstChannel, packet.DestinationChannel),
sdk.NewAttribute(channeltypes.AttributeKeyDstPort, packet.DestinationPort),
sdk.NewAttribute(channeltypes.AttributeKeyChannelID, packet.DestinationChannel),
sdk.NewAttribute(channeltypes.AttributeKeyPortID, packet.DestinationPort),
),
)
}
Expand Down
3 changes: 2 additions & 1 deletion x/ccv/provider/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,11 @@ func (k Keeper) SetConsumerChain(ctx sdk.Context, channelID string) error {
// emit event on successful addition
ctx.EventManager().EmitEvent(
sdk.NewEvent(
ccv.EventTypeConsumerChainAdded,
ccv.EventTypeChannelEstablished,
sdk.NewAttribute(sdk.AttributeKeyModule, consumertypes.ModuleName),
sdk.NewAttribute(ccv.AttributeChainID, chainID),
sdk.NewAttribute(conntypes.AttributeKeyClientID, clientID),
sdk.NewAttribute(channeltypes.AttributeKeyChannelID, channelID),
sdk.NewAttribute(conntypes.AttributeKeyConnectionID, connectionID),
),
)
Expand Down
20 changes: 10 additions & 10 deletions x/ccv/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ package types

// CCV events
const (
EventTypeTimeout = "timeout"
EventTypePacket = "ccv_packet"
EventTypeChannelClose = "channel_closed"

EventTypeConsumerChainAdded = "consumer_added"
EventTypeTimeout = "timeout"
EventTypePacket = "ccv_packet"
EventTypeChannelClose = "channel_closed"
EventTypeChannelEstablished = "channel_established"
EventTypeFeeTransferChannelOpened = "fee_channel_opened"
EventExecuteConsumerChainSlash = "execute_consumer_chain_slash"
EventTypeFirstVSCPacket = "first_vsc_packet"
EventTypeFeeDistribution = "fee_distribution"
EventTypeSendSlashPacket = "send_slash_packet"
EventTypeSendMaturedVSCPacket = "send_matured_vsc_packet"
EventTypeConsumerClientCreated = "consumer_client_created"

EventExecuteConsumerChainSlash = "execute_consumer_chain_slash"
EventTypeFeeDistribution = "fee_distribution"
EventTypeSendSlashPacket = "send_slash_packet"
EventTypeSendMaturedVSCPacket = "send_matured_vsc_packet"

AttributeKeyAckSuccess = "success"
AttributeKeyAck = "acknowledgement"
Expand Down

0 comments on commit 40f122b

Please sign in to comment.