diff --git a/x/staking/keeper/keeper.go b/x/staking/keeper/keeper.go index fe60866d0..84e1f0b95 100644 --- a/x/staking/keeper/keeper.go +++ b/x/staking/keeper/keeper.go @@ -37,7 +37,6 @@ func NewKeeper( key storetypes.StoreKey, ak types.AccountKeeper, bk types.BankKeeper, - wk types.WormholeKeeper, authority string, ) *Keeper { // ensure bonded and not bonded module accounts are set @@ -55,15 +54,21 @@ func NewKeeper( } return &Keeper{ - storeKey: key, - cdc: cdc, - authKeeper: ak, - bankKeeper: bk, - hooks: nil, - authority: authority, + storeKey: key, + cdc: cdc, + authKeeper: ak, + bankKeeper: bk, + wormholeKeeper: nil, + hooks: nil, + authority: authority, } } +// / SetWormholekeeper sets the wormhole keeper +func (k *Keeper) SetWormholekeeper(whk types.WormholeKeeper) { + k.wormholeKeeper = whk +} + func (k Keeper) IsConsensusGuardian(ctx sdk.Context, addr sdk.ValAddress) (bool, error) { return k.wormholeKeeper.IsConsensusGuardian(ctx, addr) } diff --git a/x/staking/keeper/keeper_test.go b/x/staking/keeper/keeper_test.go index 76df93a5d..3cf81a06c 100644 --- a/x/staking/keeper/keeper_test.go +++ b/x/staking/keeper/keeper_test.go @@ -56,7 +56,6 @@ func (s *KeeperTestSuite) SetupTest() { key, accountKeeper, bankKeeper, - nil, authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) keeper.SetParams(ctx, stakingtypes.DefaultParams()) diff --git a/x/staking/module.go b/x/staking/module.go index cee9f2218..1ae810201 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -237,9 +237,10 @@ func ProvideModule(in StakingInputs) StakingOutputs { in.Key, in.AccountKeeper, in.BankKeeper, - in.WormholeKeeper, authority.String(), ) + k.SetWormholekeeper(in.WormholeKeeper) + m := NewAppModule(in.Cdc, k, in.AccountKeeper, in.BankKeeper, in.WormholeKeeper, in.LegacySubspace) return StakingOutputs{StakingKeeper: k, Module: m} }