Skip to content

Commit

Permalink
feat: emit depositor when add deposit
Browse files Browse the repository at this point in the history
  • Loading branch information
duvbell committed Mar 25, 2024
1 parent adc3432 commit 61d8d49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions x/gov/keeper/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ func (k Keeper) AddDeposit(ctx context.Context, proposalID uint64, depositorAddr

if err := k.environment.EventService.EventManager(ctx).EmitKV(
types.EventTypeProposalDeposit,
event.NewAttribute(types.AttributeKeyDepositor, depositorAddr.String()),
event.NewAttribute(sdk.AttributeKeyAmount, depositAmount.String()),
event.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)),
); err != nil {
Expand Down
1 change: 1 addition & 0 deletions x/gov/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const (
AttributeKeyVoter = "voter"
AttributeKeyOption = "option"
AttributeKeyProposalID = "proposal_id"
AttributeKeyDepositor = "depositor"
AttributeKeyProposalMessages = "proposal_messages" // Msg type_urls in the proposal
AttributeKeyVotingPeriodStart = "voting_period_start"
AttributeKeyProposalLog = "proposal_log" // log of proposal execution
Expand Down

0 comments on commit 61d8d49

Please sign in to comment.