From bfd3e587c5ddcfe8d29cfdc8a42fff2ec011a04c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 1 Jan 2023 15:56:39 +0100 Subject: [PATCH] fix: return anteEvents when postHandler fail (backport #14448) (#14459) Co-authored-by: yihuang --- CHANGELOG.md | 4 ++++ baseapp/baseapp.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 631e365aacdc..8f42d23a8165 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [#14347](https://github.com/cosmos/cosmos-sdk/pull/14347) Support `v1.Proposal` message in `v1beta1.Proposal.Content`. +### Bug Fixes + +* (ante) [#14448](https://github.com/cosmos/cosmos-sdk/pull/14448) Return anteEvents when postHandler fail. + ### API Breaking * (x/gov) [#14422](https://github.com/cosmos/cosmos-sdk/pull/14422) Remove `Migrate_V046_6_To_V046_7` function which shouldn't be used for chains which already migrated to 0.46. diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 1f3c7242a252..9982606c3dd9 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -926,7 +926,7 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re newCtx, err := app.postHandler(postCtx, tx, mode == runTxModeSimulate) if err != nil { - return gInfo, nil, nil, priority, err + return gInfo, nil, anteEvents, priority, err } result.Events = append(result.Events, newCtx.EventManager().ABCIEvents()...)