Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing postCtx #14613

Merged
merged 3 commits into from
Jan 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,12 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
//
// Note: If the postHandler fails, we also revert the runMsgs state.
if app.postHandler != nil {
// Follow-up Ref: https://github.com/cosmos/cosmos-sdk/pull/13941
newCtx, err := app.postHandler(runMsgCtx, tx, mode == runTxModeSimulate, err == nil)
// The runMsgCtx context currently contains events emitted by the ante handler.
// We clear this to correctly order events without duplicates.
// Note that the state is still preserved.
postCtx := runMsgCtx.WithEventManager(sdk.NewEventManager())

newCtx, err := app.postHandler(postCtx, tx, mode == runTxModeSimulate, err == nil)
Vvaradinov marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return gInfo, nil, anteEvents, priority, err
}
Expand Down