diff --git a/CHANGELOG.md b/CHANGELOG.md index b46dae92231..4f995df8a96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (apps/27-interchain-accounts) [\#2133](https://github.com/cosmos/ibc-go/pull/2133) Generates genesis protos in a separate directory to avoid circular import errors. The protobuf package name has changed for the genesis types. * (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. +* (05-port) [\#2025](https://github.com/cosmos/ibc-go/pull/2025) Port Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. * (04-channel) [\#2024](https://github.com/cosmos/ibc-go/pull/2024) Channel Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. ### State Machine Breaking diff --git a/modules/core/05-port/keeper/keeper.go b/modules/core/05-port/keeper/keeper.go index 9903742e3f4..252e75b62c3 100644 --- a/modules/core/05-port/keeper/keeper.go +++ b/modules/core/05-port/keeper/keeper.go @@ -4,7 +4,6 @@ import ( "fmt" 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" "github.com/tendermint/tendermint/libs/log" @@ -16,11 +15,11 @@ import ( type Keeper struct { Router *types.Router - scopedKeeper capabilitykeeper.ScopedKeeper + scopedKeeper types.ScopedKeeper } // NewKeeper creates a new IBC connection Keeper instance -func NewKeeper(sck capabilitykeeper.ScopedKeeper) Keeper { +func NewKeeper(sck types.ScopedKeeper) Keeper { return Keeper{ scopedKeeper: sck, } diff --git a/modules/core/05-port/types/expected_keepers.go b/modules/core/05-port/types/expected_keepers.go new file mode 100644 index 00000000000..ca9c65f5f66 --- /dev/null +++ b/modules/core/05-port/types/expected_keepers.go @@ -0,0 +1,14 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" +) + +// ScopedKeeper defines the expected x/capability scoped keeper interface +type ScopedKeeper interface { + NewCapability(ctx sdk.Context, name string) (*capabilitytypes.Capability, error) + 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) +}