From 5a139c53ce2c2ec104310efa15ac0557a591ed3b Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 8 Aug 2022 09:36:34 -0400 Subject: [PATCH 1/3] updates --- types/events.go | 1 + x/auth/ante/fee.go | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/types/events.go b/types/events.go index dbff89ce2d02..322123b43299 100644 --- a/types/events.go +++ b/types/events.go @@ -217,6 +217,7 @@ const ( AttributeKeyAccountSequence = "acc_seq" AttributeKeySignature = "signature" AttributeKeyFee = "fee" + AttributeKeyFeePayer = "fee_payer" EventTypeMessage = "message" diff --git a/x/auth/ante/fee.go b/x/auth/ante/fee.go index 73792d3e63dd..8ebac703b16f 100644 --- a/x/auth/ante/fee.go +++ b/x/auth/ante/fee.go @@ -109,9 +109,10 @@ func (dfd DeductFeeDecorator) checkDeductFee(ctx sdk.Context, sdkTx sdk.Tx, fee } } - events := sdk.Events{sdk.NewEvent(sdk.EventTypeTx, - sdk.NewAttribute(sdk.AttributeKeyFee, fee.String()), - )} + events := sdk.Events{ + sdk.NewEvent(sdk.EventTypeTx, sdk.NewAttribute(sdk.AttributeKeyFee, fee.String())), + sdk.NewEvent(sdk.EventTypeTx, sdk.NewAttribute(sdk.AttributeKeyFeePayer, deductFeesFrom.String())), + } ctx.EventManager().EmitEvents(events) return nil From a8360c1682a40192114117c44e5fd9e52683aa3d Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 8 Aug 2022 10:10:13 -0400 Subject: [PATCH 2/3] updates --- x/auth/tx/service_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/tx/service_test.go b/x/auth/tx/service_test.go index f609d87f74ab..02d0127cccf8 100644 --- a/x/auth/tx/service_test.go +++ b/x/auth/tx/service_test.go @@ -225,7 +225,7 @@ func (s IntegrationTestSuite) TestSimulateTx_GRPC() { // - tx.* events: tx.fee, tx.acc_seq, tx.signature // - Sending Amount to recipient: coin_spent, coin_received, transfer and message.sender= // - Msg events: message.module=bank and message.action=/cosmos.bank.v1beta1.MsgSend - s.Require().Equal(len(res.GetResult().GetEvents()), 13) // 1 coin recv 1 coin spent, 1 transfer, 3 messages. + s.Require().Equal(len(res.GetResult().GetEvents()), 14) // 1 coin recv 1 coin spent, 1 transfer, 3 messages. s.Require().True(res.GetGasInfo().GetGasUsed() > 0) // Gas used sometimes change, just check it's not empty. } }) From 2c5afcfbaedd29f0b9ea44fc500d5d653d2e6ff9 Mon Sep 17 00:00:00 2001 From: Aleksandr Bezobchuk Date: Mon, 8 Aug 2022 11:54:53 -0400 Subject: [PATCH 3/3] updates --- x/auth/tx/service_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/tx/service_test.go b/x/auth/tx/service_test.go index 02d0127cccf8..b6ac4d42ed61 100644 --- a/x/auth/tx/service_test.go +++ b/x/auth/tx/service_test.go @@ -267,7 +267,7 @@ func (s IntegrationTestSuite) TestSimulateTx_GRPCGateway() { s.Require().NoError(err) // Check the result and gas used are correct. s.Require().Len(result.GetResult().MsgResponses, 1) - s.Require().Equal(len(result.GetResult().GetEvents()), 13) // See TestSimulateTx_GRPC for the 13 events. + s.Require().Equal(len(result.GetResult().GetEvents()), 14) // See TestSimulateTx_GRPC for the 13 events. s.Require().True(result.GetGasInfo().GetGasUsed() > 0) // Gas used sometimes change, jus } })