Skip to content

Commit

Permalink
fix: add missing postCtx (#14613)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vvaradinov committed Jan 13, 2023
1 parent c65f08d commit de17e6e
Showing 1 changed file with 6 additions and 2 deletions.
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)
if err != nil {
return gInfo, nil, anteEvents, priority, err
}
Expand Down

0 comments on commit de17e6e

Please sign in to comment.