diff --git a/CHANGELOG.md b/CHANGELOG.md index 1358cfcb00a..6cebfc1ea2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,7 +50,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (testing) [\#1418](https://github.com/cosmos/ibc-go/pull/1418) `MockIBCApp` has been renamed to `IBCApp` and `MockEmptyAcknowledgement` has been renamed to `EmptyAcknowledgement` to comply with go linting rules * (apps/27-interchain-accounts) [\#2058](https://github.com/cosmos/ibc-go/pull/2058) Added `MessageRouter` interface and replaced `*baseapp.MsgServiceRouter` with it. The controller and host keepers of apps/27-interchain-accounts have been updated to use it. * (apps/27-interchain-accounts)[\#2302](https://github.com/cosmos/ibc-go/pull/2302) Handle unwrapping of channel version in interchain accounts channel reopening handshake flow. The `host` submodule `Keeper` now requires an `ICS4Wrapper` similarly to the `controller` submodule. -* (apps/27-interchain-accounts) [\#2035](https://github.com/cosmos/ibc-go/pull/2035) Interchain accounts host and controller Keepers now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. ### State Machine Breaking diff --git a/docs/migrations/v4-to-v5.md b/docs/migrations/v4-to-v5.md index f3fb7cfe33b..7d322c0c43f 100644 --- a/docs/migrations/v4-to-v5.md +++ b/docs/migrations/v4-to-v5.md @@ -191,7 +191,7 @@ func NewKeeper( channelKeeper icatypes.ChannelKeeper, portKeeper icatypes.PortKeeper, accountKeeper icatypes.AccountKeeper, - scopedKeeper icatypes.ScopedKeeper, + scopedKeeper capabilitykeeper.ScopedKeeper, msgRouter icatypes.MessageRouter, ) Keeper ``` diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go index 2b281e93a45..4dec1b4adcc 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/tendermint/tendermint/libs/log" @@ -27,7 +28,7 @@ type Keeper struct { channelKeeper icatypes.ChannelKeeper portKeeper icatypes.PortKeeper - scopedKeeper icatypes.ScopedKeeper + scopedKeeper capabilitykeeper.ScopedKeeper msgRouter icatypes.MessageRouter } @@ -36,7 +37,7 @@ type Keeper struct { func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace, ics4Wrapper icatypes.ICS4Wrapper, channelKeeper icatypes.ChannelKeeper, portKeeper icatypes.PortKeeper, - scopedKeeper icatypes.ScopedKeeper, msgRouter icatypes.MessageRouter, + scopedKeeper capabilitykeeper.ScopedKeeper, msgRouter icatypes.MessageRouter, ) Keeper { // set KeyTable if it has not already been set if !paramSpace.HasKeyTable() { diff --git a/modules/apps/27-interchain-accounts/host/keeper/keeper.go b/modules/apps/27-interchain-accounts/host/keeper/keeper.go index acd582c64a5..f5a7f06560f 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/keeper.go +++ b/modules/apps/27-interchain-accounts/host/keeper/keeper.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/tendermint/tendermint/libs/log" @@ -28,7 +29,7 @@ type Keeper struct { portKeeper icatypes.PortKeeper accountKeeper icatypes.AccountKeeper - scopedKeeper icatypes.ScopedKeeper + scopedKeeper capabilitykeeper.ScopedKeeper msgRouter icatypes.MessageRouter } @@ -37,7 +38,7 @@ type Keeper struct { func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace paramtypes.Subspace, ics4Wrapper icatypes.ICS4Wrapper, channelKeeper icatypes.ChannelKeeper, portKeeper icatypes.PortKeeper, - accountKeeper icatypes.AccountKeeper, scopedKeeper icatypes.ScopedKeeper, msgRouter icatypes.MessageRouter, + accountKeeper icatypes.AccountKeeper, scopedKeeper capabilitykeeper.ScopedKeeper, msgRouter icatypes.MessageRouter, ) Keeper { // ensure ibc interchain accounts module account is set if addr := accountKeeper.GetModuleAddress(icatypes.ModuleName); addr == nil { diff --git a/modules/apps/27-interchain-accounts/types/expected_keepers.go b/modules/apps/27-interchain-accounts/types/expected_keepers.go index 787969d9f0e..00110df91cb 100644 --- a/modules/apps/27-interchain-accounts/types/expected_keepers.go +++ b/modules/apps/27-interchain-accounts/types/expected_keepers.go @@ -36,11 +36,3 @@ type PortKeeper interface { BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability IsBound(ctx sdk.Context, portID string) bool } - -// ScopedKeeper defines the expected x/capability scoped keeper interface -type ScopedKeeper interface { - GetCapability(ctx sdk.Context, name string) (*capabilitytypes.Capability, bool) - AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool - LookupModules(ctx sdk.Context, name string) ([]string, *capabilitytypes.Capability, error) - ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error -}