Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Mar 25, 2024
1 parent 255a456 commit 055b37c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 120 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

* (x/gov) [#19853](https://github.com/cosmos/cosmos-sdk/pull/19853) Emit `depositor` in `EventTypeProposalDeposit`.
* (x/gov) [#19844](https://github.com/cosmos/cosmos-sdk/pull/19844) Emit the proposer of governance proposals.

## Bug Fixes
Expand Down
76 changes: 0 additions & 76 deletions x/gov/CHANGELOG.md

This file was deleted.

12 changes: 1 addition & 11 deletions x/gov/keeper/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,25 +164,15 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito
return false, err
}

<<<<<<< HEAD
sdkCtx := sdk.UnwrapSDKContext(ctx)
sdkCtx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeProposalDeposit,
sdk.NewAttribute(types.AttributeKeyDepositor, depositorAddr.String()),
sdk.NewAttribute(sdk.AttributeKeyAmount, depositAmount.String()),
sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)),
),
)
=======
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 {
return false, err
}
>>>>>>> d1c3547d8 (feat(x/gov): emit depositor in `proposal_deposit` event (#19853))

err = keeper.SetDeposit(ctx, deposit)
if err != nil {
Expand Down
12 changes: 0 additions & 12 deletions x/gov/keeper/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met
return v1.Proposal{}, err
}

<<<<<<< HEAD
sdkCtx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeSubmitProposal,
Expand All @@ -128,17 +127,6 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met
sdk.NewAttribute(types.AttributeKeyProposalMessages, msgsStr),
),
)
=======
if err := k.environment.EventService.EventManager(ctx).EmitKV(
types.EventTypeSubmitProposal,
event.NewAttribute(types.AttributeKeyProposalType, proposalType.String()),
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)
}
>>>>>>> d1c3547d8 (feat(x/gov): emit depositor in `proposal_deposit` event (#19853))

return proposal, nil
}
Expand Down
22 changes: 1 addition & 21 deletions x/gov/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ const (
EventTypeActiveProposal = "active_proposal"
EventTypeCancelProposal = "cancel_proposal"

<<<<<<< HEAD
AttributeKeyProposalResult = "proposal_result"
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 All @@ -24,26 +24,6 @@ const (
AttributeValueProposalFailed = "proposal_failed" // error on proposal handler
AttributeValueProposalCanceled = "proposal_canceled" // error on proposal handler
AttributeKeyProposalProposer = "proposal_proposer" // account address of the proposer
=======
AttributeKeyProposalResult = "proposal_result"
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
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
AttributeValueProposalRejected = "proposal_rejected" // didn't meet vote quorum
AttributeValueExpeditedProposalRejected = "expedited_proposal_rejected" // didn't meet expedited vote quorum
AttributeValueOptimisticProposalRejected = "optimistic_proposal_rejected" // didn't meet optimistic vote quorum
AttributeValueProposalFailed = "proposal_failed" // error on proposal handler
AttributeValueProposalCanceled = "proposal_canceled" // error on proposal handler
>>>>>>> d1c3547d8 (feat(x/gov): emit depositor in `proposal_deposit` event (#19853))

AttributeKeyProposalType = "proposal_type"
AttributeSignalTitle = "signal_title"
Expand Down

0 comments on commit 055b37c

Please sign in to comment.