/
expected_keeper.go
59 lines (48 loc) · 2.48 KB
/
expected_keeper.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
connectiontypes "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types"
channeltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"
ibcexported "github.com/cosmos/ibc-go/v3/modules/core/exported"
subspacestypes "github.com/magewar/mage/x/subspaces/types"
)
// DONTCOVER
// SubspacesKeeper represents the expected keeper used to interact with subspaces
type SubspacesKeeper interface {
// HasSubspace tells if the subspace with the given id exists
HasSubspace(ctx sdk.Context, subspaceID uint64) bool
// GetAllSubspaces returns all the subspaces stored
GetAllSubspaces(ctx sdk.Context) []subspacestypes.Subspace
}
// RelationshipsKeeper represents the expected keeper used to interact with relationships
type RelationshipsKeeper interface {
// IsUserBlocked returns true if the provided blocker has blocked the given user for the given subspace.
// If the provided subspace is empty, all subspaces will be checked
HasUserBlocked(ctx sdk.Context, user, blocker string, subspaceID uint64) bool
}
// ChannelKeeper defines the expected IBC channel keeper
type ChannelKeeper interface {
GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool)
GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool)
SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error
ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error
}
// ClientKeeper defines the expected IBC client keeper
type ClientKeeper interface {
GetClientConsensusState(ctx sdk.Context, clientID string) (connection ibcexported.ConsensusState, found bool)
}
// ConnectionKeeper defines the expected IBC connection keeper
type ConnectionKeeper interface {
GetConnection(ctx sdk.Context, connectionID string) (connection connectiontypes.ConnectionEnd, found bool)
}
// PortKeeper defines the expected IBC port keeper
type PortKeeper interface {
BindPort(ctx sdk.Context, portID string) *capabilitytypes.Capability
}
// ScopedKeeper defines the expected scoped keeper
type ScopedKeeper interface {
AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool
ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error
GetCapability(ctx sdk.Context, name string) (*capabilitytypes.Capability, bool)
}