Skip to content

Commit

Permalink
chore(staking): add delegator to events (backport #18006) (#18011)
Browse files Browse the repository at this point in the history
Co-authored-by: Marko <[email protected]>
  • Loading branch information
mergify[bot] and tac0turtle authored Oct 9, 2023
1 parent ef5c356 commit b0d20bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions x/staking/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ func (k msgServer) Delegate(ctx context.Context, msg *types.MsgDelegate) (*types
sdk.NewEvent(
types.EventTypeDelegate,
sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress),
sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress),
sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.String()),
sdk.NewAttribute(types.AttributeKeyNewShares, newShares.String()),
),
Expand Down Expand Up @@ -447,6 +448,7 @@ func (k msgServer) Undelegate(ctx context.Context, msg *types.MsgUndelegate) (*t
sdk.NewEvent(
types.EventTypeUnbond,
sdk.NewAttribute(types.AttributeKeyValidator, msg.ValidatorAddress),
sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress),
sdk.NewAttribute(sdk.AttributeKeyAmount, undelegatedCoin.String()),
sdk.NewAttribute(types.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)),
),
Expand Down

0 comments on commit b0d20bc

Please sign in to comment.