fix: add delegator address to redelegate event (#25258)
Co-authored-by: Alex | Interchain Labs <alex@djinntek.world> Co-authored-by: Alex | Interchain Labs <alex@cosmoslabs.io>
This commit is contained in:
parent
b070d0ba79
commit
c8ededc504
@ -71,6 +71,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
* (x/epochs) [#24770](https://github.com/cosmos/cosmos-sdk/pull/24770) Fix register of epoch hooks in `InvokeSetHooks`.
|
||||
* (x/epochs) [#25087](https://github.com/cosmos/cosmos-sdk/pull/25087) Remove redundant error check in BeginBlocker.
|
||||
* [GHSA-p22h-3m2v-cmgh](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-p22h-3m2v-cmgh) Fix x/distribution can halt when historical rewards overflow.
|
||||
* (x/staking) [#25258](https://github.com/cosmos/cosmos-sdk/pull/25258) Add delegator address to redelegate event.
|
||||
|
||||
### Deprecated
|
||||
|
||||
|
||||
@ -373,6 +373,7 @@ func (k msgServer) BeginRedelegate(ctx context.Context, msg *types.MsgBeginRedel
|
||||
types.EventTypeRedelegate,
|
||||
sdk.NewAttribute(types.AttributeKeySrcValidator, msg.ValidatorSrcAddress),
|
||||
sdk.NewAttribute(types.AttributeKeyDstValidator, msg.ValidatorDstAddress),
|
||||
sdk.NewAttribute(types.AttributeKeyDelegator, msg.DelegatorAddress),
|
||||
sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Amount.String()),
|
||||
sdk.NewAttribute(types.AttributeKeyCompletionTime, completionTime.Format(time.RFC3339)),
|
||||
),
|
||||
|
||||
@ -693,6 +693,10 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() {
|
||||
require.Contains(err.Error(), tc.expErrMsg)
|
||||
} else {
|
||||
require.NoError(err)
|
||||
events := ctx.EventManager().Events()
|
||||
delegator, found := events.GetAttributes("delegator")
|
||||
s.Require().Equal(delegator[0].Value, tc.input.DelegatorAddress)
|
||||
s.Require().Equal(true, found)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user