From 20734b3487a6b0f53b509d4a0f463515b0779630 Mon Sep 17 00:00:00 2001 From: Facundo Date: Tue, 3 Oct 2023 09:17:27 +0200 Subject: [PATCH 1/3] merge --- runtime/builder.go | 1 - 1 file changed, 1 deletion(-) diff --git a/runtime/builder.go b/runtime/builder.go index e3bb56545a3e..72bf965f7082 100644 --- a/runtime/builder.go +++ b/runtime/builder.go @@ -35,7 +35,6 @@ func (a *AppBuilder) Build(db dbm.DB, traceStore io.Writer, baseAppOptions ...fu bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(a.app.interfaceRegistry) bApp.MountStores(a.app.storeKeys...) - bApp.SetPreBlocker(a.app.PreBlocker) a.app.BaseApp = bApp a.app.configurator = module.NewConfigurator(a.app.cdc, a.app.MsgServiceRouter(), a.app.GRPCQueryRouter()) From 2c4f85166e8efcaa5ccc03981418e1d63d67c1da Mon Sep 17 00:00:00 2001 From: Facundo Date: Tue, 10 Oct 2023 10:53:03 +0200 Subject: [PATCH 2/3] update comment in app --- simapp/app_v2.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simapp/app_v2.go b/simapp/app_v2.go index 82a787a57fff..7339f821a73d 100644 --- a/simapp/app_v2.go +++ b/simapp/app_v2.go @@ -256,7 +256,7 @@ func NewSimApp( // However, when registering a module manually (i.e. that does not support app wiring), the module version map // must be set manually as follow. The upgrade module will de-duplicate the module version map. // - // app.SetInitChainer(func(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { + // app.SetInitChainer(func(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) { // app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()) // return app.App.InitChainer(ctx, req) // }) From 97d7d29941d0bafd0969c67acb33f8c4e0332c6e Mon Sep 17 00:00:00 2001 From: Facundo Date: Tue, 10 Oct 2023 11:57:49 +0200 Subject: [PATCH 3/3] check if preblocker is set before setting it in runtime --- baseapp/options.go | 4 ++++ runtime/app.go | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/baseapp/options.go b/baseapp/options.go index 68d2704b3610..6a89a7730adf 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -184,6 +184,10 @@ func (app *BaseApp) SetInitChainer(initChainer sdk.InitChainer) { app.initChainer = initChainer } +func (app *BaseApp) PreBlocker() sdk.PreBlocker { + return app.preBlocker +} + func (app *BaseApp) SetPreBlocker(preBlocker sdk.PreBlocker) { if app.sealed { panic("SetPreBlocker() on sealed BaseApp") diff --git a/runtime/app.go b/runtime/app.go index ca7f45ffbaee..a581740e3b78 100644 --- a/runtime/app.go +++ b/runtime/app.go @@ -116,7 +116,9 @@ func (a *App) Load(loadLatest bool) error { if len(a.config.PreBlockers) != 0 { a.ModuleManager.SetOrderPreBlockers(a.config.PreBlockers...) - a.SetPreBlocker(a.PreBlocker) + if a.BaseApp.PreBlocker() == nil { + a.SetPreBlocker(a.PreBlocker) + } } if len(a.config.BeginBlockers) != 0 {