now it creates the module account on InitChain

This commit is contained in:
Jonathan Gimeno
2020-03-05 11:45:51 +01:00
parent b9ab834732
commit e01c99d019
5 changed files with 45 additions and 6 deletions
+9 -3
View File
@@ -5,6 +5,8 @@ import (
"fmt"
"math/rand"
"github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/gorilla/mux"
"github.com/spf13/cobra"
@@ -74,14 +76,16 @@ func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command {
type AppModule struct {
AppModuleBasic
keeper Keeper
keeper Keeper
supplyKeeper types.SupplyKeeper
}
// NewAppModule creates a new AppModule object
func NewAppModule(keeper Keeper) AppModule {
func NewAppModule(keeper Keeper, supplyKeeper types.SupplyKeeper) AppModule {
return AppModule{
AppModuleBasic: AppModuleBasic{},
keeper: keeper,
supplyKeeper: supplyKeeper,
}
}
@@ -114,7 +118,9 @@ func (am AppModule) NewQuerierHandler() sdk.Querier {
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, data json.RawMessage) []abci.ValidatorUpdate {
var genesisState GenesisState
cdc.MustUnmarshalJSON(data, &genesisState)
InitGenesis(ctx, am.keeper, genesisState)
InitGenesis(ctx, am.keeper, am.supplyKeeper, genesisState)
return []abci.ValidatorUpdate{}
}