Skip to content

Commit f3b34fd

Browse files
feat(x/bank): add origin address in event multisend (backport #21460) (#21465)
Co-authored-by: Julien Robert <julien@rbrt.fr>
1 parent 2f81f5c commit f3b34fd

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
4242

4343
* (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.
4444

45+
### Improvements
46+
47+
* (x/bank) [#21460](https://github.com/cosmos/cosmos-sdk/pull/21460) Added `Sender` attribute in `MsgMultiSend` event.
48+
4549
### Bug Fixes
4650

4751
* (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.

x/bank/keeper/keeper_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,20 +1454,17 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() {
14541454
event2.Attributes = append(
14551455
event2.Attributes,
14561456
abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: accAddrs[2].String()},
1457+
abci.EventAttribute{Key: banktypes.AttributeKeySender, Value: accAddrs[0].String()},
1458+
abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()},
14571459
)
1458-
event2.Attributes = append(
1459-
event2.Attributes,
1460-
abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()})
14611460
event3 := sdk.Event{
14621461
Type: banktypes.EventTypeTransfer,
14631462
Attributes: []abci.EventAttribute{},
14641463
}
14651464
event3.Attributes = append(
14661465
event3.Attributes,
14671466
abci.EventAttribute{Key: banktypes.AttributeKeyRecipient, Value: accAddrs[3].String()},
1468-
)
1469-
event3.Attributes = append(
1470-
event3.Attributes,
1467+
abci.EventAttribute{Key: banktypes.AttributeKeySender, Value: accAddrs[0].String()},
14711468
abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins2.String()},
14721469
)
14731470
// events are shifted due to the funding account events

x/bank/keeper/send.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input,
185185
sdk.NewEvent(
186186
types.EventTypeTransfer,
187187
sdk.NewAttribute(types.AttributeKeyRecipient, outAddress.String()),
188+
sdk.NewAttribute(types.AttributeKeySender, input.Address),
188189
sdk.NewAttribute(sdk.AttributeKeyAmount, out.Coins.String()),
189190
),
190191
)

0 commit comments

Comments
 (0)