diff --git a/x/bank/internal/keeper/keeper.go b/x/bank/internal/keeper/keeper.go index 25e47b073932..8e5f5faa5c8d 100644 --- a/x/bank/internal/keeper/keeper.go +++ b/x/bank/internal/keeper/keeper.go @@ -219,9 +219,11 @@ func (keeper BaseSendKeeper) InputOutputCoins(ctx sdk.Context, inputs []types.In // SendCoins moves coins from one account to another func (keeper BaseSendKeeper) SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error { ctx.EventManager().EmitEvents(sdk.Events{ + // This event should have all info (to, from, amount) without looking at other events sdk.NewEvent( types.EventTypeTransfer, sdk.NewAttribute(types.AttributeKeyRecipient, toAddr.String()), + sdk.NewAttribute(types.AttributeKeySender, fromAddr.String()), sdk.NewAttribute(sdk.AttributeKeyAmount, amt.String()), ), sdk.NewEvent( diff --git a/x/bank/internal/keeper/keeper_test.go b/x/bank/internal/keeper/keeper_test.go index 6b6f3cd4048f..1f8b38ab5723 100644 --- a/x/bank/internal/keeper/keeper_test.go +++ b/x/bank/internal/keeper/keeper_test.go @@ -170,9 +170,8 @@ func TestMsgSendEvents(t *testing.T) { } event1.Attributes = append( event1.Attributes, - tmkv.Pair{Key: []byte(types.AttributeKeyRecipient), Value: []byte(addr2.String())}) - event1.Attributes = append( - event1.Attributes, + tmkv.Pair{Key: []byte(types.AttributeKeyRecipient), Value: []byte(addr2.String())}, + tmkv.Pair{Key: []byte(types.AttributeKeySender), Value: []byte(addr.String())}, tmkv.Pair{Key: []byte(sdk.AttributeKeyAmount), Value: []byte(newCoins.String())}) event2 := sdk.Event{ Type: sdk.EventTypeMessage,