Skip to content

Commit

Permalink
chore(staking): add delegator to events (#18006)
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Oct 9, 2023
1 parent 68a136b commit b170ccc
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 @@ -302,6 +302,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 @@ -446,6 +447,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 b170ccc

Please sign in to comment.