feat(core): add begin/end block extension interfaces (#14604)
This commit is contained in:
parent
de17e6e6c5
commit
fa7ff32f35
@ -1,6 +1,8 @@
|
||||
package appmodule
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"cosmossdk.io/depinject"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
@ -35,3 +37,23 @@ type HasServices interface {
|
||||
// do not need to specify this in golang code.
|
||||
RegisterServices(grpc.ServiceRegistrar)
|
||||
}
|
||||
|
||||
// HasBeginBlocker is the extension interface that modules should implement to run
|
||||
// custom logic before transaction processing in a block.
|
||||
type HasBeginBlocker interface {
|
||||
AppModule
|
||||
|
||||
// BeginBlock is a method that will be run before transactions are processed in
|
||||
// a block.
|
||||
BeginBlock(context.Context) error
|
||||
}
|
||||
|
||||
// HasEndBlocker is the extension interface that modules should implement to run
|
||||
// custom logic after transaction processing in a block.
|
||||
type HasEndBlocker interface {
|
||||
AppModule
|
||||
|
||||
// EndBlock is a method that will be run after transactions are processed in
|
||||
// a block.
|
||||
EndBlock(context.Context) error
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user