Skip to content

Commit

Permalink
add consumer registration event
Browse files Browse the repository at this point in the history
  • Loading branch information
bermuell committed Aug 29, 2024
1 parent 289e05c commit b017871
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x/ccv/provider/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@ func (k msgServer) CreateConsumer(goCtx context.Context, msg *types.MsgCreateCon
}
}

ctx.EventManager().EmitEvents(sdk.Events{
sdk.NewEvent(ccvtypes.EventTypeConsumerRegistration,
sdk.NewAttribute(ccvtypes.AttributeConsumerID, consumerId),
),
})

return &types.MsgCreateConsumerResponse{ConsumerId: consumerId}, nil
}

Expand Down
2 changes: 2 additions & 0 deletions x/ccv/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const (
EventTypeExecuteConsumerChainSlash = "execute_consumer_chain_slash"
EventTypeFeeDistribution = "fee_distribution"
EventTypeConsumerSlashRequest = "consumer_slash_request"
EventTypeConsumerRegistration = "consumer_registration"

AttributeKeyAckSuccess = "success"
AttributeKeyAck = "acknowledgement"
Expand All @@ -34,6 +35,7 @@ const (
AttributeMisbehaviourHeight1 = "misbehaviour_height_1"
AttributeMisbehaviourHeight2 = "misbehaviour_height_2"
AttributeConsumerDoubleVoting = "consumer_double_voting"
AttributeConsumerID = "consumer_id"
AttributeChainID = "chain_id"
AttributeValidatorAddress = "validator_address"
AttributeInfractionType = "infraction_type"
Expand Down

0 comments on commit b017871

Please sign in to comment.