feat(x/gov): emit proposer address in submit proposal event (#19842)

This commit is contained in:
Aryan Tikarya 2024-03-24 15:23:51 +05:30 committed by GitHub
parent ac61b69ae1
commit 45994391ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -147,6 +147,7 @@ func (k Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, metadata
if err := k.environment.EventService.EventManager(ctx).EmitKV(
types.EventTypeSubmitProposal,
event.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)),
event.NewAttribute(types.AttributeKeyProposalProposer, proposer.String()),
event.NewAttribute(types.AttributeKeyProposalMessages, strings.Join(msgs, ",")),
); err != nil {
return v1.Proposal{}, fmt.Errorf("failed to emit event: %w", err)

View File

@ -17,6 +17,7 @@ const (
AttributeKeyVotingPeriodStart = "voting_period_start"
AttributeKeyProposalLog = "proposal_log" // log of proposal execution
AttributeKeyProposalDepositError = "proposal_deposit_error" // error on proposal deposit refund/burn
AttributeKeyProposalProposer = "proposal_proposer" // account address of the proposer
AttributeValueProposalDropped = "proposal_dropped" // didn't meet min deposit
AttributeValueProposalPassed = "proposal_passed" // met vote quorum