Skip to content

Commit

Permalink
fix(baseapp): preblock events are not emmitted correctly (backport #2…
Browse files Browse the repository at this point in the history
…1444) (#21457)

Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
  • Loading branch information
mergify[bot] and facundomedica committed Aug 29, 2024
1 parent 243b819 commit 275eb61
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (sdk.Context
func (app *BaseApp) preBlock(req *abci.FinalizeBlockRequest) ([]abci.Event, error) {
var events []abci.Event
if app.preBlocker != nil {
ctx := app.finalizeBlockState.Context()
ctx := app.finalizeBlockState.Context().WithEventManager(sdk.NewEventManager())
if err := app.preBlocker(ctx, req); err != nil {
return nil, err
}
Expand Down
1 change: 0 additions & 1 deletion types/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,6 @@ func (m Manager) RunMigrations(ctx context.Context, cfg Configurator, fromVM app
// It takes the current context as a parameter and returns a boolean value
// indicating whether the migration was successfully executed or not.
func (m *Manager) PreBlock(ctx sdk.Context) error {
ctx = ctx.WithEventManager(sdk.NewEventManager())
for _, moduleName := range m.OrderPreBlockers {
if module, ok := m.Modules[moduleName].(appmodule.HasPreBlocker); ok {
if err := module.PreBlock(ctx); err != nil {
Expand Down

0 comments on commit 275eb61

Please sign in to comment.