diff --git a/CHANGELOG.md b/CHANGELOG.md index dd73d04d79d2..370c39b819bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (cli) [#20779](https://github.com/cosmos/cosmos-sdk/pull/20779) Added `module-hash-by-height` command to query and retrieve module hashes at a specified blockchain height, enhancing debugging capabilities. +### Improvements + +* (x/bank) [#21460](https://github.com/cosmos/cosmos-sdk/pull/21460) Added `Sender` attribute in `MsgMultiSend` event. + ### Bug Fixes * (baseapp) [#21256](https://github.com/cosmos/cosmos-sdk/pull/21256) Halt height will not commit the block indicated, meaning that if halt-height is set to 10, only blocks until 9 (included) will be committed. This is to go back to the original behavior before a change was introduced in v0.50.0. diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 4bb11862eb62..325b471c8e56 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -1454,10 +1454,9 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() { event2.Attributes = append( event2.Attributes, abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: accAddrs[2].String()}, + abci.EventAttribute{Key: banktypes.AttributeKeySender, Value: accAddrs[0].String()}, + abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()}, ) - event2.Attributes = append( - event2.Attributes, - abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()}) event3 := sdk.Event{ Type: banktypes.EventTypeTransfer, Attributes: []abci.EventAttribute{}, @@ -1465,9 +1464,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() { event3.Attributes = append( event3.Attributes, abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: accAddrs[3].String()}, - ) - event3.Attributes = append( - event3.Attributes, + abci.EventAttribute{Key: banktypes.AttributeKeySender, Value: accAddrs[0].String()}, abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins2.String()}, ) // events are shifted due to the funding account events diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index c8aad5446f3b..7deedf473e3d 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -185,6 +185,7 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input, sdk.NewEvent( types.EventTypeTransfer, sdk.NewAttribute(types.AttributeKeyRecipient, outAddress.String()), + sdk.NewAttribute(types.AttributeKeySender, input.Address), sdk.NewAttribute(sdk.AttributeKeyAmount, out.Coins.String()), ), )