feat(x/bank): add origin address in event multisend (backport #21460) (#21465)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot] 2024-08-29 15:14:21 +00:00 committed by GitHub
parent 2f81f5c40a
commit f3b34fdd56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 6 deletions

View File

@ -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.

View File

@ -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

View File

@ -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()),
),
)