From 9ad155970f26c6558734e691f53819a425825731 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 15:13:19 -0400 Subject: [PATCH] chore: fee payer event (backport #12850) (#12856) --- 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 2bc9f55b996a..667475d8deac 100644 --- a/types/events.go +++ b/types/events.go @@ -288,6 +288,7 @@ var ( 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 4c8de37218cc..e0d978d10db6 100644 --- a/x/auth/ante/fee.go +++ b/x/auth/ante/fee.go @@ -134,9 +134,10 @@ func (dfd *DeductFeeDecorator) checkDeductFee(ctx context.Context, feeTx sdk.Fee } } - events := sdk.Events{sdk.NewEvent(sdk.EventTypeTx, - sdk.NewAttribute(sdk.AttributeKeyFee, feeTx.GetFee().String()), - )} + events := sdk.Events{ + sdk.NewEvent(sdk.EventTypeTx, sdk.NewAttribute(sdk.AttributeKeyFee, feeTx.GetFee().String())), + sdk.NewEvent(sdk.EventTypeTx, sdk.NewAttribute(sdk.AttributeKeyFeePayer, deductFeesFrom.String())), + } ctx.EventManager().EmitEvents(events) return next(ctx, tx, simulate)