Skip to content

Commit

Permalink
democ: correctly override staking InitGenesis
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek committed Mar 8, 2024
1 parent 158a8e4 commit e731e82
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions x/ccv/democracy/staking/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"

"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/staking/exported"
Expand Down Expand Up @@ -41,11 +42,11 @@ type AppModule struct {

// NewAppModule creates a new AppModule object using the native x/staking module
// AppModule constructor.
func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper, subspace exported.Subspace) AppModule {
stakingAppMod := staking.NewAppModule(cdc, &keeper, ak, bk, subspace)
func NewAppModule(cdc codec.Codec, keeper *keeper.Keeper, ak types.AccountKeeper, bk types.BankKeeper, subspace exported.Subspace) AppModule {
stakingAppMod := staking.NewAppModule(cdc, keeper, ak, bk, subspace)
return AppModule{
AppModule: stakingAppMod,
keeper: keeper,
keeper: *keeper,
accKeeper: ak,
bankKeeper: bk,
}
Expand All @@ -59,7 +60,7 @@ func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak types.AccountKeeper,
// Note: InitGenesis is not called during the soft upgrade of a module
// (as a part of a changeover from standalone -> consumer chain),
// so there is no special handling needed in this method for a consumer being in the pre-CCV state.
func (am AppModule) InitGenesis(ctx context.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate {
func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate {
var genesisState types.GenesisState

cdc.MustUnmarshalJSON(data, &genesisState)
Expand Down

0 comments on commit e731e82

Please sign in to comment.