diff --git a/testutil/keeper/initializer.go b/testutil/keeper/initializer.go index e476ab99..9edd842a 100644 --- a/testutil/keeper/initializer.go +++ b/testutil/keeper/initializer.go @@ -388,7 +388,7 @@ func (i initializer) Monitoringc( func (i initializer) Monitoringp( stakingKeeper *stakingkeeper.Keeper, - ibcKeeper ibckeeper.Keeper, + ibcKeeper *ibckeeper.Keeper, capabilityKeeper capabilitykeeper.Keeper, portKeeper portkeeper.Keeper, connectionMock []Connection, @@ -430,12 +430,9 @@ func (i initializer) Monitoringp( }, stakingKeeper, ) - k.SetIBCKeepers( - ibcKeeper.ClientKeeper, - connKeeper, - channelKeeper, - ibcKeeper.PortKeeper, - ) + k.SetIBCKeeper(ibcKeeper) + k.SetConnectionKeeper(connKeeper) + k.SetChannelKeeper(channelKeeper) return k } diff --git a/testutil/keeper/monitoring_provider.go b/testutil/keeper/monitoring_provider.go index 737acd02..8e98eda0 100644 --- a/testutil/keeper/monitoring_provider.go +++ b/testutil/keeper/monitoring_provider.go @@ -41,17 +41,17 @@ func NewTestSetupWithIBCMocksMonitoringp( paramKeeper := initializer.Param() capabilityKeeper := initializer.Capability() - scopedKeeper := capabilityKeeper.ScopeToModule(ibcexported.ModuleName) - portKeeper := portkeeper.NewKeeper(scopedKeeper) authKeeper := initializer.Auth(paramKeeper) bankKeeper := initializer.Bank(paramKeeper, authKeeper) stakingKeeper := initializer.Staking(authKeeper, bankKeeper, paramKeeper) distrKeeper := initializer.Distribution(authKeeper, bankKeeper, stakingKeeper) upgradeKeeper := initializer.Upgrade() + scopedKeeper := capabilityKeeper.ScopeToModule(ibcexported.ModuleName) ibcKeeper := initializer.IBC(paramKeeper, stakingKeeper, scopedKeeper, upgradeKeeper) + portKeeper := portkeeper.NewKeeper(scopedKeeper) monitoringProviderKeeper := initializer.Monitoringp( stakingKeeper, - *ibcKeeper, + ibcKeeper, *capabilityKeeper, portKeeper, connectionMock, diff --git a/x/monitoringc/keeper/keeper.go b/x/monitoringc/keeper/keeper.go index 04e040eb..74016dd9 100644 --- a/x/monitoringc/keeper/keeper.go +++ b/x/monitoringc/keeper/keeper.go @@ -122,7 +122,7 @@ func (k Keeper) AddressCodec() address.Codec { // IBC Keeper Logic // ---------------------------------------------------------------------------- -// SetIBCKeeper sets IBC Keeper +// SetIBCKeeper sets the IBC Keeper func (k *Keeper) SetIBCKeeper(ibcKeeper *ibckeeper.Keeper) { k.SetClientKeeper(ibcKeeper.ClientKeeper) k.SetPortKeeper(ibcKeeper.PortKeeper) diff --git a/x/monitoringp/keeper/keeper.go b/x/monitoringp/keeper/keeper.go index 4c84bd99..8c8295a2 100644 --- a/x/monitoringp/keeper/keeper.go +++ b/x/monitoringp/keeper/keeper.go @@ -112,37 +112,31 @@ func (k Keeper) AddressCodec() address.Codec { // IBC Keeper Logic // ---------------------------------------------------------------------------- -// SetIBCKeepers sets all IBC Keepers -// TODO set -func (k Keeper) SetIBCKeepers( - clientKeeper types.ClientKeeper, - connectionKeeper types.ConnectionKeeper, - channelKeeper types.ChannelKeeper, - portKeeper types.PortKeeper, -) { - k.SetClientKeeper(clientKeeper) - k.SetPortKeeper(portKeeper) - k.SetConnectionKeeper(connectionKeeper) - k.SetChannelKeeper(channelKeeper) +// SetIBCKeeper sets the IBC Keeper +func (k *Keeper) SetIBCKeeper(ibcKeeper *ibckeeper.Keeper) { + k.SetClientKeeper(ibcKeeper.ClientKeeper) + k.SetPortKeeper(ibcKeeper.PortKeeper) + k.SetConnectionKeeper(ibcKeeper.ConnectionKeeper) + k.SetChannelKeeper(ibcKeeper.ChannelKeeper) } // SetClientKeeper sets IBC client keeper -func (k Keeper) SetClientKeeper(clientKeeper types.ClientKeeper) { +func (k *Keeper) SetClientKeeper(clientKeeper types.ClientKeeper) { k.clientKeeper = clientKeeper } // SetPortKeeper sets IBC port keeper -func (k Keeper) SetPortKeeper(portKeeper types.PortKeeper) { +func (k *Keeper) SetPortKeeper(portKeeper types.PortKeeper) { k.portKeeper = portKeeper } // SetConnectionKeeper sets IBC connection keeper -func (k Keeper) SetConnectionKeeper(connectionKeeper types.ConnectionKeeper) { +func (k *Keeper) SetConnectionKeeper(connectionKeeper types.ConnectionKeeper) { k.connectionKeeper = connectionKeeper } // SetChannelKeeper sets IBC channel keeper -func (k Keeper) SetChannelKeeper(channelKeeper types.ChannelKeeper) { +func (k *Keeper) SetChannelKeeper(channelKeeper types.ChannelKeeper) { k.channelKeeper = channelKeeper }