Skip to content

Commit

Permalink
chore: fee payer event (backport cosmos#12850) (cosmos#12856)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored and JeancarloBarrios committed Sep 28, 2024
1 parent a1907c6 commit 9ad1559
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ var (
AttributeKeyAccountSequence = "acc_seq"
AttributeKeySignature = "signature"
AttributeKeyFee = "fee"
AttributeKeyFeePayer = "fee_payer"

EventTypeMessage = "message"

Expand Down
7 changes: 4 additions & 3 deletions x/auth/ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9ad1559

Please sign in to comment.