Skip to content

Commit

Permalink
feat(x/bank): add origin address in event multisend (backport #21460) (
Browse files Browse the repository at this point in the history
…#21464)

Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
mergify[bot] and julienrbrt authored Aug 29, 2024
1 parent 2c1f4fa commit 32ab717
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions x/bank/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1468,20 +1468,18 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() {
event1.Attributes = append(
event1.Attributes,
coreevent.Attribute{Key: banktypes.AttributeKeyRecipient, Value: acc2StrAddr},
coreevent.Attribute{Key: sdk.AttributeKeySender, Value: acc0StrAddr},
coreevent.Attribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()},
)
event1.Attributes = append(
event1.Attributes,
coreevent.Attribute{Key: sdk.AttributeKeyAmount, Value: newCoins.String()})

event2 := coreevent.Event{
Type: banktypes.EventTypeTransfer,
Attributes: []coreevent.Attribute{},
}
event2.Attributes = append(
event2.Attributes,
coreevent.Attribute{Key: banktypes.AttributeKeyRecipient, Value: acc3StrAddr},
)
event2.Attributes = append(
event2.Attributes,
coreevent.Attribute{Key: sdk.AttributeKeySender, Value: acc0StrAddr},
coreevent.Attribute{Key: sdk.AttributeKeyAmount, Value: newCoins2.String()},
)
// events are shifted due to the funding account events
Expand Down
1 change: 1 addition & 0 deletions x/bank/keeper/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input,
if err := k.EventService.EventManager(ctx).EmitKV(
types.EventTypeTransfer,
event.NewAttribute(types.AttributeKeyRecipient, out.Address),
event.NewAttribute(types.AttributeKeySender, input.Address),
event.NewAttribute(sdk.AttributeKeyAmount, out.Coins.String()),
); err != nil {
return err
Expand Down

0 comments on commit 32ab717

Please sign in to comment.