From 9edc87d1147f3513d99370f41f7547c993e54572 Mon Sep 17 00:00:00 2001 From: Thomas Nguy <81727899+thomas-nguy@users.noreply.github.com> Date: Thu, 19 May 2022 19:11:26 +0900 Subject: [PATCH] fix: append `Log` in tx post processing response (#1088) * fix post processing log * update changelog --- CHANGELOG.md | 1 + x/evm/keeper/state_transition.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c944b898..212eebd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (rpc) [tharsis#1082](https://github.com/tharsis/ethermint/pull/1082) fix gas price returned in getTransaction api. +* (evm) [tharsis#1088](https://github.com/tharsis/ethermint/pull/1088) Fix ability to append log in tx post processing. ## [v0.15.0] - 2022-05-09 diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index a0fcf792..f2633d50 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -271,6 +271,8 @@ func (k *Keeper) ApplyTransaction(ctx sdk.Context, tx *ethtypes.Transaction) (*t } else if commit != nil { // PostTxProcessing is successful, commit the tmpCtx commit() + // Since the post processing can alter the log, we need to update the result + res.Logs = types.NewLogsFromEth(receipt.Logs) ctx.EventManager().EmitEvents(tmpCtx.EventManager().Events()) } }