Skip to content

Commit

Permalink
fix ibc keeper pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Oct 16, 2024
1 parent 7552c70 commit 35580b4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 27 deletions.
11 changes: 4 additions & 7 deletions testutil/keeper/initializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}

Expand Down
6 changes: 3 additions & 3 deletions testutil/keeper/monitoring_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion x/monitoringc/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 10 additions & 16 deletions x/monitoringp/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 35580b4

Please sign in to comment.