Skip to content

Commit 33c463e

Browse files
authored
feat(x/bank): add origin address in event multisend (#21460)
1 parent 43f59c8 commit 33c463e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

x/bank/keeper/keeper_test.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -1468,20 +1468,18 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() {
14681468
event1.Attributes = append(
14691469
event1.Attributes,
14701470
coreevent.Attribute{Key: banktypes.AttributeKeyRecipient, Value: acc2StrAddr},
1471+
coreevent.Attribute{Key: sdk.AttributeKeySender, Value: acc0StrAddr},
1472+
coreevent.Attribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()},
14711473
)
1472-
event1.Attributes = append(
1473-
event1.Attributes,
1474-
coreevent.Attribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()})
1474+
14751475
event2 := coreevent.Event{
14761476
Type: banktypes.EventTypeTransfer,
14771477
Attributes: []coreevent.Attribute{},
14781478
}
14791479
event2.Attributes = append(
14801480
event2.Attributes,
14811481
coreevent.Attribute{Key: banktypes.AttributeKeyRecipient, Value: acc3StrAddr},
1482-
)
1483-
event2.Attributes = append(
1484-
event2.Attributes,
1482+
coreevent.Attribute{Key: sdk.AttributeKeySender, Value: acc0StrAddr},
14851483
coreevent.Attribute{Key: sdk.AttributeKeyAmount, Value: newCoins2.String()},
14861484
)
14871485
// events are shifted due to the funding account events

x/bank/keeper/send.go

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input,
172172
if err := k.EventService.EventManager(ctx).EmitKV(
173173
types.EventTypeTransfer,
174174
event.NewAttribute(types.AttributeKeyRecipient, out.Address),
175+
event.NewAttribute(types.AttributeKeySender, input.Address),
175176
event.NewAttribute(sdk.AttributeKeyAmount, out.Coins.String()),
176177
); err != nil {
177178
return err

0 commit comments

Comments
 (0)