refactor(modules): adopt appmodulev2.Hasgenesis (#19627)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
Marko
2024-03-11 10:22:16 +00:00
committed by GitHub
co-authored by Julien Robert
parent d4e52069f7
commit d2e40963ed
72 changed files with 686 additions and 694 deletions
+8 -3
View File
@@ -3,13 +3,18 @@ package appmodule
import (
"context"
"io"
appmodule "cosmossdk.io/core/appmodule/v2"
)
// HasGenesis is the extension interface that modules should implement to handle
// HasGenesis defines a custom genesis handling API implementation.
type HasGenesis = appmodule.HasGenesis
// HasGenesisAuto is the extension interface that modules should implement to handle
// genesis data and state initialization.
// WARNING: This interface is experimental and may change at any time.
type HasGenesis interface {
AppModule
type HasGenesisAuto interface {
appmodule.AppModule
// DefaultGenesis writes the default genesis for this module to the target.
DefaultGenesis(GenesisTarget) error
+4 -4
View File
@@ -57,7 +57,7 @@ type ResponsePreBlock interface {
// HasPreBlocker is the extension interface that modules should implement to run
// custom logic before BeginBlock.
type HasPreBlocker interface {
AppModule
appmodule.AppModule
// PreBlock is method that will be run before BeginBlock.
PreBlock(context.Context) (ResponsePreBlock, error)
}
@@ -91,12 +91,12 @@ type HasMsgHandler interface {
// HasPrepareCheckState is an extension interface that contains information about the AppModule
// and PrepareCheckState.
type HasPrepareCheckState interface {
AppModule
appmodule.AppModule
PrepareCheckState(context.Context) error
}
// HasPrecommit is an extension interface that contains information about the AppModule and Precommit.
// HasPrecommit is an extension interface that contains information about the appmodule.AppModule and Precommit.
type HasPrecommit interface {
AppModule
appmodule.AppModule
Precommit(context.Context) error
}
+1 -1
View File
@@ -10,7 +10,7 @@ import (
// migration of existing modules to the new app module API. It is intended to be replaced by collections
type HasGenesis interface {
AppModule
DefaultGenesis() Message
DefaultGenesis() json.RawMessage
ValidateGenesis(data json.RawMessage) error
InitGenesis(ctx context.Context, data json.RawMessage) error
ExportGenesis(ctx context.Context) (json.RawMessage, error)