-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5858aa
commit f27418d
Showing
2 changed files
with
21 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |