From 3dc538fd81521306bd60cf4ba9817aa1e2a2498a Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 24 May 2022 20:33:51 +0200 Subject: [PATCH] feat: Add sender to fungible_token_packet events (backport #1414) (#1420) * Add Sender to funginble_token_packet events (cherry picked from commit f05a7cf8840ead622e7b5628466e1f9a311a717d) # Conflicts: # modules/apps/transfer/ibc_module.go * chore: Updated CHANGELOG.md (cherry picked from commit c809c518423de21c576b8a80fec7fb5f5e07fca8) # Conflicts: # CHANGELOG.md * Update CHANGELOG.md (cherry picked from commit d8be3d0ce674c004d7543413cbeba3455d7028e2) # Conflicts: # CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Damian Nolan (cherry picked from commit 46d73a09352d7db7b01d006f64627d519919f44e) # Conflicts: # CHANGELOG.md * fix conflicts * nit in changelog * Update CHANGELOG.md Co-authored-by: chatton Co-authored-by: Cian Hatton Co-authored-by: crodriguezvega --- CHANGELOG.md | 1 + modules/apps/transfer/module.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cdd4985d0f..181fcd2a66b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (modules/core/04-channel) [\#1160](https://github.com/cosmos/ibc-go/pull/1160) Improve `uint64 -> string` performance in `Logger`. * (modules/core/keeper) [\#1284](https://github.com/cosmos/ibc-go/pull/1284) Add sanity check for the keepers passed into `ibckeeper.NewKeeper`. `ibckeeper.NewKeeper` now panics if any of the keepers passed in is empty. +* (transfer) [\#1414](https://github.com/cosmos/ibc-go/pull/1414) Emitting Sender address from `fungible_token_packet` events in `OnRecvPacket` and `OnAcknowledgementPacket`. ### Features diff --git a/modules/apps/transfer/module.go b/modules/apps/transfer/module.go index a2a7a32a6b9..8f2b1668145 100644 --- a/modules/apps/transfer/module.go +++ b/modules/apps/transfer/module.go @@ -345,6 +345,7 @@ func (am AppModule) OnRecvPacket( sdk.NewEvent( types.EventTypePacket, sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(sdk.AttributeKeySender, data.Sender), sdk.NewAttribute(types.AttributeKeyReceiver, data.Receiver), sdk.NewAttribute(types.AttributeKeyDenom, data.Denom), sdk.NewAttribute(types.AttributeKeyAmount, fmt.Sprintf("%d", data.Amount)), @@ -380,6 +381,7 @@ func (am AppModule) OnAcknowledgementPacket( sdk.NewEvent( types.EventTypePacket, sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(sdk.AttributeKeySender, data.Sender), sdk.NewAttribute(types.AttributeKeyReceiver, data.Receiver), sdk.NewAttribute(types.AttributeKeyDenom, data.Denom), sdk.NewAttribute(types.AttributeKeyAmount, fmt.Sprintf("%d", data.Amount)),