From 2921a1c3c91883cccd4e44b2b10931f612feb6bd 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 35b1de3fe..bcd76df24 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 e46259ec9..74999a629 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -276,7 +276,7 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx 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{