Skip to content

Commit

Permalink
fix app v2 build (genesis still not working)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed May 2, 2023
1 parent 660c34f commit 37d2d62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions x/group/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ import (
)

type Keeper struct {
appmodule.HasGenesis

accKeeper group.AccountKeeper
state groupv1.StateStore
router baseapp.MessageRouter
config group.Config
modDb ormdb.ModuleDB

// used for migrations
storeService store.KVStoreService
Expand All @@ -52,11 +51,11 @@ func NewKeeper(storeService store.KVStoreService, cdc codec.Codec, router baseap
}

return Keeper{
HasGenesis: modDb.GenesisHandler(),
router: router,
accKeeper: accKeeper,
state: state,
config: config,
router: router,
accKeeper: accKeeper,
state: state,
config: config,
modDb: modDb,
// used for migrations
storeService: storeService,
cdc: cdc,
Expand All @@ -68,6 +67,11 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", fmt.Sprintf("x/%s", group.ModuleName))
}

// GenesisHandler returns the genesis handler for the group module.
func (k Keeper) GenesisHandler() appmodule.HasGenesis {
return k.modDb.GenesisHandler()
}

// proposalsByVPEnd returns all proposals whose voting_period_end is after the `endTime` time argument.
func (k Keeper) proposalsByVPEnd(ctx sdk.Context, endTime time.Time) (proposals []group.Proposal, err error) {
it, err := k.state.ProposalTable().List(ctx, groupv1.ProposalVotingPeriodEndIndexKey{}.WithVotingPeriodEnd(timestamppb.New(endTime)))
Expand Down
2 changes: 1 addition & 1 deletion x/group/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ type AppModule struct {
// NewAppModule creates a new AppModule object
func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak group.AccountKeeper, bk group.BankKeeper, registry cdctypes.InterfaceRegistry) AppModule {
return AppModule{
HasGenesis: keeper.HasGenesis,
HasGenesis: keeper.GenesisHandler(),
AppModuleBasic: AppModuleBasic{cdc: cdc, ac: ak},
keeper: keeper,
bankKeeper: bk,
Expand Down

0 comments on commit 37d2d62

Please sign in to comment.