Skip to content

Commit

Permalink
events for both add and remove
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Sep 12, 2023
1 parent 93b68a9 commit a2ed4df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
6 changes: 5 additions & 1 deletion x/ccv/provider/keeper/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ func (k Keeper) HandleConsumerRewardDenomProposal(ctx sdk.Context, p *types.Chan
}
k.SetConsumerRewardDenom(ctx, denomToAdd)
ctx.EventManager().EmitEvent(sdk.NewEvent(
ccv.EventTypeRegisterConsumerRewardDenom,
ccv.EventTypeAddConsumerRewardDenom,
sdk.NewAttribute(ccv.AttributeConsumerRewardDenom, denomToAdd),
))
}
Expand All @@ -637,6 +637,10 @@ func (k Keeper) HandleConsumerRewardDenomProposal(ctx sdk.Context, p *types.Chan
continue
}
k.DeleteConsumerRewardDenom(ctx, denomToRemove)
ctx.EventManager().EmitEvent(sdk.NewEvent(
ccv.EventTypeRemoveConsumerRewardDenom,
sdk.NewAttribute(ccv.AttributeConsumerRewardDenom, denomToRemove),
))
}
return nil
}
15 changes: 8 additions & 7 deletions x/ccv/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package types

// CCV events
const (
EventTypeTimeout = "timeout"
EventTypePacket = "ccv_packet"
EventTypeChannelEstablished = "channel_established"
EventTypeFeeTransferChannelOpened = "fee_transfer_channel_opened"
EventTypeConsumerClientCreated = "consumer_client_created"
EventTypeAssignConsumerKey = "assign_consumer_key"
EventTypeRegisterConsumerRewardDenom = "register_consumer_reward_denom"
EventTypeTimeout = "timeout"
EventTypePacket = "ccv_packet"
EventTypeChannelEstablished = "channel_established"
EventTypeFeeTransferChannelOpened = "fee_transfer_channel_opened"
EventTypeConsumerClientCreated = "consumer_client_created"
EventTypeAssignConsumerKey = "assign_consumer_key"
EventTypeAddConsumerRewardDenom = "add_consumer_reward_denom"
EventTypeRemoveConsumerRewardDenom = "remove_consumer_reward_denom"

EventTypeExecuteConsumerChainSlash = "execute_consumer_chain_slash"
EventTypeFeeDistribution = "fee_distribution"
Expand Down

0 comments on commit a2ed4df

Please sign in to comment.