Co-authored-by: mmsqe <mavis@crypto.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
co-authored by
mmsqe
Julien Robert
parent
92d1d9a106
commit
4c083c6f23
@@ -114,6 +114,11 @@ func (a *App) Load(loadLatest bool) error {
|
||||
a.ModuleManager.SetOrderExportGenesis(a.config.InitGenesis...)
|
||||
}
|
||||
|
||||
if len(a.config.PreBlockers) != 0 {
|
||||
a.ModuleManager.SetOrderPreBlockers(a.config.PreBlockers...)
|
||||
a.SetPreBlocker(a.PreBlocker)
|
||||
}
|
||||
|
||||
if len(a.config.BeginBlockers) != 0 {
|
||||
a.ModuleManager.SetOrderBeginBlockers(a.config.BeginBlockers...)
|
||||
a.SetBeginBlocker(a.BeginBlocker)
|
||||
@@ -147,6 +152,11 @@ func (a *App) Load(loadLatest bool) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// PreBlocker application updates every pre block
|
||||
func (a *App) PreBlocker(ctx sdk.Context) (sdk.ResponsePreBlock, error) {
|
||||
return a.ModuleManager.PreBlock(ctx)
|
||||
}
|
||||
|
||||
// BeginBlocker application updates every begin block
|
||||
func (a *App) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error) {
|
||||
return a.ModuleManager.BeginBlock(ctx)
|
||||
|
||||
@@ -35,6 +35,7 @@ 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())
|
||||
|
||||
Reference in New Issue
Block a user