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 interface for scoped keeper for 04-channel #2024

Merged
merged 9 commits into from
Aug 22, 2022
5 changes: 2 additions & 3 deletions modules/core/04-channel/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
"github.com/tendermint/tendermint/libs/log"
db "github.com/tendermint/tm-db"
Expand All @@ -33,14 +32,14 @@ type Keeper struct {
clientKeeper types.ClientKeeper
connectionKeeper types.ConnectionKeeper
portKeeper types.PortKeeper
scopedKeeper capabilitykeeper.ScopedKeeper
scopedKeeper types.ScopedKeeper
}

// NewKeeper creates a new IBC channel Keeper instance
func NewKeeper(
cdc codec.BinaryCodec, key storetypes.StoreKey,
clientKeeper types.ClientKeeper, connectionKeeper types.ConnectionKeeper,
portKeeper types.PortKeeper, scopedKeeper capabilitykeeper.ScopedKeeper,
portKeeper types.PortKeeper, scopedKeeper types.ScopedKeeper,
) Keeper {
return Keeper{
storeKey: key,
Expand Down
6 changes: 6 additions & 0 deletions modules/core/04-channel/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,9 @@ type ConnectionKeeper interface {
type PortKeeper interface {
Authenticate(ctx sdk.Context, key *capabilitytypes.Capability, portID string) bool
}

type ScopedKeeper interface {
Anmol1696 marked this conversation as resolved.
Show resolved Hide resolved
NewCapability(ctx sdk.Context, name string) (*capabilitytypes.Capability, error)
AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
LookupModules(ctx sdk.Context, name string) ([]string, *capabilitytypes.Capability, error)
}