Skip to content

Commit 58bbcd9

Browse files
fix(baseapp): preblock events are not emmitted correctly (#21444)
1 parent 1bbeb9c commit 58bbcd9

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

baseapp/baseapp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (sdk.Context
711711
func (app *BaseApp) preBlock(req *abci.FinalizeBlockRequest) ([]abci.Event, error) {
712712
var events []abci.Event
713713
if app.preBlocker != nil {
714-
ctx := app.finalizeBlockState.Context()
714+
ctx := app.finalizeBlockState.Context().WithEventManager(sdk.NewEventManager())
715715
if err := app.preBlocker(ctx, req); err != nil {
716716
return nil, err
717717
}

types/module/module.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,6 @@ func (m Manager) RunMigrations(ctx context.Context, cfg Configurator, fromVM app
714714
// It takes the current context as a parameter and returns a boolean value
715715
// indicating whether the migration was successfully executed or not.
716716
func (m *Manager) PreBlock(ctx sdk.Context) error {
717-
ctx = ctx.WithEventManager(sdk.NewEventManager())
718717
for _, moduleName := range m.OrderPreBlockers {
719718
if module, ok := m.Modules[moduleName].(appmodule.HasPreBlocker); ok {
720719
if err := module.PreBlock(ctx); err != nil {

0 commit comments

Comments
 (0)