fix(baseapp): preblock events are not emmitted correctly (#21444)

This commit is contained in:
Facundo Medica 2024-08-29 10:59:20 +02:00 committed by GitHub
parent 1bbeb9c6fa
commit 58bbcd9d75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 2 deletions

View File

@ -711,7 +711,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
}

View File

@ -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 {