diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 4bb11862eb62..8f14fdeb6e49 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -1449,6 +1449,7 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() { event2 := sdk.Event{ Type: banktypes.EventTypeTransfer, +<<<<<<< HEAD Attributes: []abci.EventAttribute{}, } event2.Attributes = append( @@ -1469,6 +1470,26 @@ func (suite *KeeperTestSuite) TestMsgMultiSendEvents() { event3.Attributes = append( event3.Attributes, abci.EventAttribute{Key: sdk.AttributeKeyAmount, Value: newCoins2.String()}, +======= + Attributes: []coreevent.Attribute{}, + } + 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()}, + ) + + event2 := coreevent.Event{ + Type: banktypes.EventTypeTransfer, + Attributes: []coreevent.Attribute{}, + } + event2.Attributes = append( + event2.Attributes, + coreevent.Attribute{Key: banktypes.AttributeKeyRecipient, Value: acc3StrAddr}, + coreevent.Attribute{Key: sdk.AttributeKeySender, Value: acc0StrAddr}, + coreevent.Attribute{Key: sdk.AttributeKeyAmount, Value: newCoins2.String()}, +>>>>>>> 33c463ec2 (feat(x/bank): add origin address in event multisend (#21460)) ) // events are shifted due to the funding account events require.Equal(abci.Event(event1), events[25]) diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index c8aad5446f3b..0421d8c4811d 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -181,6 +181,7 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input, return err } +<<<<<<< HEAD sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeTransfer, @@ -197,6 +198,15 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input, if !accExists { defer telemetry.IncrCounter(1, "new", "account") k.ak.SetAccount(ctx, k.ak.NewAccountWithAddress(ctx, outAddress)) +======= + 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 +>>>>>>> 33c463ec2 (feat(x/bank): add origin address in event multisend (#21460)) } }