Skip to content

Commit

Permalink
update node module
Browse files Browse the repository at this point in the history
  • Loading branch information
sin3A committed Jul 24, 2024
1 parent cc544d3 commit f4802d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion modules/node/depinject.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func ProvideModule(in NodeInputs) NodeOutputs {
subspace,
)
//nodekeeper.SetHooks(in.StakingKeeper.Hooks())
m := NewAppModule(in.Cdc, *nodekeeper)
m := NewAppModule(in.Cdc, nodekeeper)

return NodeOutputs{NodeKeeper: nodekeeper, Module: m}
}
Expand Down
16 changes: 8 additions & 8 deletions modules/node/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ func (AppModuleBasic) BuildCreateValidatorMsg(cliCtx client.Context, txBldr tx.F
type AppModule struct {
AppModuleBasic

keeper Keeper
keeper *Keeper
}

// NewAppModule creates a new AppModule object
func NewAppModule(cdc codec.Codec, keeper Keeper) AppModule {
func NewAppModule(cdc codec.Codec, keeper *Keeper) AppModule {
return AppModule{
AppModuleBasic: AppModuleBasic{cdc: cdc},
keeper: keeper,
Expand All @@ -128,8 +128,8 @@ func (AppModule) Name() string {

// RegisterServices registers module services.
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
types.RegisterQueryServer(cfg.QueryServer(), keeper.Querier{Keeper: am.keeper})
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(*am.keeper))
types.RegisterQueryServer(cfg.QueryServer(), keeper.Querier{Keeper: *am.keeper})
}

// RegisterInvariants registers the node module invariants.
Expand All @@ -155,12 +155,12 @@ func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {}
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate {
var genesisState GenesisState
cdc.MustUnmarshalJSON(data, &genesisState)
return InitGenesis(ctx, am.cdc, am.keeper, genesisState)
return InitGenesis(ctx, am.cdc, *am.keeper, genesisState)
}

// ExportGenesis returns the exported genesis state as raw bytes for the node module.
func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {
gs := ExportGenesis(ctx, am.keeper)
gs := ExportGenesis(ctx, *am.keeper)
return cdc.MustMarshalJSON(gs)
}

Expand All @@ -169,12 +169,12 @@ func (AppModule) ConsensusVersion() uint64 { return 1 }

// BeginBlock returns the begin blocker for the node module.
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
BeginBlocker(ctx, am.keeper)
BeginBlocker(ctx, *am.keeper)
}

// EndBlock returns the end blocker for the node module. It returns no validator updates.
func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
return EndBlocker(ctx, am.keeper)
return EndBlocker(ctx, *am.keeper)
}

// ____________________________________________________________________________
Expand Down

0 comments on commit f4802d3

Please sign in to comment.