From 42248afca9f441e16915dabd6545449f7c915e6d Mon Sep 17 00:00:00 2001 From: Vladislav Varadinov Date: Tue, 10 Jan 2023 18:58:10 +0200 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- baseapp/baseapp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 4f21e7147d4c..717b02cba3eb 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -727,7 +727,7 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re return gInfo, nil, events, priority, err } - // Case 2: Run PostHandler and only + // Case 2: tx errors and the post handler is set. Run PostHandler and revert state from runMsgs if err != nil && app.postHandler != nil { // Run optional postHandlers with a context branched off the ante handler ctx postCtx, postCache := app.cacheTxContext(ctx, txBytes) @@ -761,7 +761,7 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re return gInfo, result, events, priority, err } - // Case 3: Run Post Handler with runMsgCtx so that the state from runMsgs is persisted + // Case 3: tx successful and post handler is set. Run Post Handler with runMsgCtx so that the state from runMsgs is persisted if app.postHandler != nil { newCtx, err := app.postHandler(runMsgCtx, tx, mode == runTxModeSimulate, err == nil) if err != nil {