From 5af3d6eefe51cf6560d0238e9298266fbed319f4 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 20 Mar 2023 11:36:46 +0100 Subject: [PATCH 1/3] add delegator to withdraw address --- x/distribution/keeper/delegation.go | 1 + x/distribution/types/events.go | 1 + 2 files changed, 2 insertions(+) diff --git a/x/distribution/keeper/delegation.go b/x/distribution/keeper/delegation.go index 7e3579bf4c1b..952c5c3c9f6e 100644 --- a/x/distribution/keeper/delegation.go +++ b/x/distribution/keeper/delegation.go @@ -206,6 +206,7 @@ func (k Keeper) withdrawDelegationRewards(ctx sdk.Context, val stakingtypes.Vali types.EventTypeWithdrawRewards, sdk.NewAttribute(sdk.AttributeKeyAmount, finalRewards.String()), sdk.NewAttribute(types.AttributeKeyValidator, val.GetOperator().String()), + sdk.NewAttribute(types.AttributeKeyValidator, del.GetDelegatorAddr().String()), ), ) diff --git a/x/distribution/types/events.go b/x/distribution/types/events.go index 47c6b83b09aa..e0ea7069106b 100644 --- a/x/distribution/types/events.go +++ b/x/distribution/types/events.go @@ -11,4 +11,5 @@ const ( AttributeKeyWithdrawAddress = "withdraw_address" AttributeKeyValidator = "validator" + AttributeKeyDelegator = "delegator" ) From c95f422de0b635aabd0c1a25edb8a9750402fe0d Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 20 Mar 2023 11:38:43 +0100 Subject: [PATCH 2/3] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af35701bdf3a..7f405f3e7da7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,6 +92,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/staking) [#14590](https://github.com/cosmos/cosmos-sdk/pull/14590) Return undelegate amount in MsgUndelegateResponse. * (baseapp) [#15023](https://github.com/cosmos/cosmos-sdk/pull/15023) & [#15213](https://github.com/cosmos/cosmos-sdk/pull/15213) Add `MessageRouter` interface to baseapp and pass it to authz, gov and groups instead of concrete type. * (simtestutil) [#15305](https://github.com/cosmos/cosmos-sdk/pull/15305) Add `AppStateFnWithExtendedCb` with callback function to extend rawState. +* (x/distribution) [#15462](https://github.com/cosmos/cosmos-sdk/pull/15462) Add delegator address to the event for withdrawing delegation rewards ### State Machine Breaking From 85c690fec77d42445392588a813a03cc1385cdd7 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 20 Mar 2023 15:13:02 +0100 Subject: [PATCH 3/3] update --- x/distribution/keeper/delegation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/distribution/keeper/delegation.go b/x/distribution/keeper/delegation.go index 952c5c3c9f6e..3eb9f2b03c7d 100644 --- a/x/distribution/keeper/delegation.go +++ b/x/distribution/keeper/delegation.go @@ -206,7 +206,7 @@ func (k Keeper) withdrawDelegationRewards(ctx sdk.Context, val stakingtypes.Vali types.EventTypeWithdrawRewards, sdk.NewAttribute(sdk.AttributeKeyAmount, finalRewards.String()), sdk.NewAttribute(types.AttributeKeyValidator, val.GetOperator().String()), - sdk.NewAttribute(types.AttributeKeyValidator, del.GetDelegatorAddr().String()), + sdk.NewAttribute(types.AttributeKeyDelegator, del.GetDelegatorAddr().String()), ), )