refactor(core)!: clean-up core and simplify preblock (#19672)

This commit is contained in:
Julien Robert
2024-03-11 14:39:37 +00:00
committed by GitHub
parent defab1a1a1
commit fea88d13c5
21 changed files with 110 additions and 177 deletions
+2 -2
View File
@@ -11,8 +11,7 @@ type HasConsensusVersion interface {
ConsensusVersion() uint64
}
// HasMigrations is implemented by a module which upgrades or has upgraded
// to a new consensus version.
// HasMigrations is implemented by a module which upgrades or has upgraded to a new consensus version.
type HasMigrations interface {
AppModule
HasConsensusVersion
@@ -21,6 +20,7 @@ type HasMigrations interface {
RegisterMigrations(MigrationRegistrar) error
}
// MigrationRegistrar is the interface for registering in-place store migrations.
type MigrationRegistrar interface {
// Register registers an in-place store migration for a module. The
// handler is a migration script to perform in-place migrations from version
@@ -19,6 +19,14 @@ type AppModule interface {
IsOnePerModuleType()
}
// HasPreBlocker is the extension interface that modules should implement to run
// custom logic before BeginBlock.
type HasPreBlocker interface {
AppModule
// PreBlock is method that will be run before BeginBlock.
PreBlock(context.Context) error
}
// HasBeginBlocker is the extension interface that modules should implement to run
// custom logic before transaction processing in a block.
type HasBeginBlocker interface {