Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scoped keeper interface for 05-port module #2025

Merged
merged 10 commits into from
Aug 22, 2022
5 changes: 2 additions & 3 deletions modules/core/05-port/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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,
}
Expand Down
13 changes: 13 additions & 0 deletions modules/core/05-port/types/expected_keepers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package types

import (
sdk "github.com/cosmos/cosmos-sdk/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
)

type ScopedKeeper interface {
Anmol1696 marked this conversation as resolved.
Show resolved Hide resolved
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)
}