Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
testinginprod committed Feb 20, 2024
1 parent f5858aa commit f27418d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
10 changes: 2 additions & 8 deletions core/appmodule/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,11 @@ type HasPrecommit interface {
// It can modify consensus parameters in storage and signal the caller through the return value.
// When it returns ConsensusParamsChanged=true, the caller must refresh the consensus parameter in the finalize context.
// The new context (ctx) must be passed to all the other lifecycle methods.
type ResponsePreBlock interface {
IsConsensusParamsChanged() bool
}
type ResponsePreBlock = appmodule.ResponsePreBlock

// 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) (ResponsePreBlock, error)
}
type HasPreBlocker = appmodule.HasPreBlocker

// HasServices is the extension interface that modules should implement to register
// implementations of services defined in .proto files.
Expand Down
19 changes: 19 additions & 0 deletions core/appmodule/v2/comet.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package appmodule

import "context"

// ResponsePreBlock represents the response from the PreBlock method.
// It can modify consensus parameters in storage and signal the caller through the return value.
// When it returns ConsensusParamsChanged=true, the caller must refresh the consensus parameter in the finalize context.
// The new context (ctx) must be passed to all the other lifecycle methods.
type ResponsePreBlock interface {
IsConsensusParamsChanged() bool
}

// 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) (ResponsePreBlock, error)
}

0 comments on commit f27418d

Please sign in to comment.