refactor: introduce abciGenesis interface (backport #17554) (#17575)

Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
mergify[bot]
2023-08-31 13:05:57 +02:00
committed by GitHub
co-authored by Marko
parent b2627e9fae
commit 013889de23
40 changed files with 654 additions and 595 deletions
+2 -3
View File
@@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
abci "github.com/cometbft/cometbft/abci/types"
gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/spf13/cobra"
@@ -118,6 +117,7 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak authz.AccountKeeper,
var (
_ appmodule.AppModule = AppModule{}
_ appmodule.HasBeginBlocker = AppModule{}
_ module.HasGenesis = AppModule{}
)
// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
@@ -133,11 +133,10 @@ func (AppModule) Name() string {
// InitGenesis performs genesis initialization for the authz module. It returns
// no validator updates.
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate {
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) {
var genesisState authz.GenesisState
cdc.MustUnmarshalJSON(data, &genesisState)
am.keeper.InitGenesis(ctx, &genesisState)
return []abci.ValidatorUpdate{}
}
// ExportGenesis returns the exported genesis state as raw bytes for the authz