From badcb345aa4e5ba155344e764d2ea9edcdf62bbe Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 23 May 2022 23:42:35 +0800 Subject: [PATCH] fix: index ante events for failed tx (backport: #12013) (#12017) --- CHANGELOG.md | 1 + baseapp/abci.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35b1de3fe28..bcd76df24e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/feegrant) [\#11813](https://github.com/cosmos/cosmos-sdk/pull/11813) Fix pagination total count in `AllowancesByGranter` query. * (errors) [\#12002](https://github.com/cosmos/cosmos-sdk/pull/12002) Removed 'redacted' error message from defaultErrEncoder. +* (ante) [#12017](https://github.com/cosmos/cosmos-sdk/pull/12017) Index ante events for failed tx (backport #12013). ### Bug Fixes diff --git a/baseapp/abci.go b/baseapp/abci.go index d2e765dface..c24a308596a 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -281,7 +281,7 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliv gInfo, result, anteEvents, err := app.runTx(runTxModeDeliver, req.Tx) if err != nil { resultStr = "failed" - return sdkerrors.ResponseDeliverTxWithEvents(err, gInfo.GasWanted, gInfo.GasUsed, anteEvents, app.trace) + return sdkerrors.ResponseDeliverTxWithEvents(err, gInfo.GasWanted, gInfo.GasUsed, sdk.MarkEventsToIndex(anteEvents, app.indexEvents), app.trace) } return abci.ResponseDeliverTx{