Skip to content

Commit

Permalink
fix(baseapp): preblock events are not emmitted correctly (#21444)
Browse files Browse the repository at this point in the history
(cherry picked from commit 58bbcd9)

# Conflicts:
#	baseapp/baseapp.go
#	types/module/module.go
  • Loading branch information
facundomedica authored and mergify[bot] committed Aug 29, 2024
1 parent 2f81f5c commit b7a5265
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,14 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (sdk.Context
func (app *BaseApp) preBlock(req *abci.RequestFinalizeBlock) ([]abci.Event, error) {
var events []abci.Event
if app.preBlocker != nil {
<<<<<<< HEAD

Check failure on line 710 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '<<'

Check failure on line 710 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected <<, expected }

Check failure on line 710 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected <<, expected }

Check failure on line 710 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected <<, expected }

Check failure on line 710 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected <<, expected }

Check failure on line 710 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected <<, expected }

Check failure on line 710 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected <<, expected }
ctx := app.finalizeBlockState.Context()
rsp, err := app.preBlocker(ctx, req)
if err != nil {

Check failure on line 713 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / dependency-review

undefined: err
=======

Check failure on line 714 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '=='

Check failure on line 714 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected ==, expected }

Check failure on line 714 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected ==, expected }

Check failure on line 714 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected ==, expected }

Check failure on line 714 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected ==, expected }

Check failure on line 714 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected ==, expected }

Check failure on line 714 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected ==, expected }
ctx := app.finalizeBlockState.Context().WithEventManager(sdk.NewEventManager())
if err := app.preBlocker(ctx, req); err != nil {

Check failure on line 716 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / dependency-review

undefined: ctx

Check failure on line 716 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / dependency-review

assignment mismatch: 1 variable but app.preBlocker returns 2 values
>>>>>>> 58bbcd9d7 (fix(baseapp): preblock events are not emmitted correctly (#21444))

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / dependency-review

expected statement, found '>>'

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / dependency-review

illegal character U+0023 '#'

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (02)

syntax error: unexpected >>, expected }

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (02)

invalid character U+0023 '#'

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (03)

syntax error: unexpected >>, expected }

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (03)

invalid character U+0023 '#'

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected >>, expected }

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (01)

invalid character U+0023 '#'

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (01)

syntax error: unexpected >>, expected }

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (01)

invalid character U+0023 '#'

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected >>, expected }

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (00)

invalid character U+0023 '#'

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (00)

syntax error: unexpected >>, expected }

Check failure on line 717 in baseapp/baseapp.go

View workflow job for this annotation

GitHub Actions / tests (00)

invalid character U+0023 '#'
return nil, err
}
// rsp.ConsensusParamsChanged is true from preBlocker means ConsensusParams in store get changed
Expand Down
4 changes: 4 additions & 0 deletions types/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,13 @@ func (m Manager) RunMigrations(ctx context.Context, cfg Configurator, fromVM Ver
// PreBlock performs begin block functionality for upgrade module.
// It takes the current context as a parameter and returns a boolean value
// indicating whether the migration was successfully executed or not.
<<<<<<< HEAD
func (m *Manager) PreBlock(ctx sdk.Context) (*sdk.ResponsePreBlock, error) {
ctx = ctx.WithEventManager(sdk.NewEventManager())
paramsChanged := false
=======
func (m *Manager) PreBlock(ctx sdk.Context) error {
>>>>>>> 58bbcd9d7 (fix(baseapp): preblock events are not emmitted correctly (#21444))
for _, moduleName := range m.OrderPreBlockers {
if module, ok := m.Modules[moduleName].(appmodule.HasPreBlocker); ok {
rsp, err := module.PreBlock(ctx)
Expand Down

0 comments on commit b7a5265

Please sign in to comment.