keeper

package
v0.0.0-...-a2f4e79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const StoreKey = types.ModuleName

StoreKey is the store key string for nft

Variables

View Source
var (
	ErrProtocolExists       = sdkerrors.Register(types.ModuleName, 1, "protocol already exists")
	ErrProtocolDoesNotExist = sdkerrors.Register(types.ModuleName, 2, "protocol does not exist")
	ErrNotProtocolCreator   = sdkerrors.Register(types.ModuleName, 3, "not protocol creator")
	ErrProtocolIsFrozen     = sdkerrors.Register(types.ModuleName, 4, "protocol is frozen")
)
View Source
var (
	ProtocolKey     = []byte{0x01}
	CollectionIdKey = []byte{0x02}

	Delimiter   = []byte{0xDD}
	Placeholder = []byte{0xFF}

	BalanceKeyDelimiter = "-"
)

Functions

func ConstructCollectionIdForProtocolKey

func ConstructCollectionIdForProtocolKey(protocolName string, address string) string

func GetDetailsFromKey

func GetDetailsFromKey(id string) (string, string)

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,
	channelKeeper types.ChannelKeeper,
	portKeeper types.PortKeeper,
	scopedKeeper exported.ScopedKeeper,

	badgesKeeper types.BadgesKeeper,
) *Keeper

func (Keeper) AuthenticateCapability

func (k Keeper) AuthenticateCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) bool

AuthenticateCapability wraps the scopedKeeper's AuthenticateCapability function

func (Keeper) BindPort

func (k Keeper) BindPort(ctx sdk.Context, portID string) error

BindPort defines a wrapper function for the port Keeper's function in order to expose it to module's InitGenesis function

func (Keeper) ChanCloseInit

func (k Keeper) ChanCloseInit(ctx sdk.Context, portID, channelID string) error

ChanCloseInit defines a wrapper function for the channel Keeper's function.

func (Keeper) ClaimCapability

func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error

ClaimCapability allows the IBC app module to claim a capability that core IBC passes to it

func (Keeper) DeleteProtocolCollectionFromStore

func (k Keeper) DeleteProtocolCollectionFromStore(ctx sdk.Context, protocolName string, address string)

DeleteProtocolFromStore deletes a badge from the store.

func (Keeper) DeleteProtocolFromStore

func (k Keeper) DeleteProtocolFromStore(ctx sdk.Context, protocolName string)

DeleteProtocolFromStore deletes a badge from the store.

func (Keeper) GetCollectionIdForProtocol

Queries a balance for the given address and badgeId and returns its contents.

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

GetParams get all parameters as types.Params

func (Keeper) GetPort

func (k Keeper) GetPort(ctx sdk.Context) string

GetPort returns the portID for the IBC app module. Used in ExportGenesis

func (Keeper) GetProtocol

Queries a balance for the given address and badgeId and returns its contents.

func (Keeper) GetProtocolCollectionFromStore

func (k Keeper) GetProtocolCollectionFromStore(ctx sdk.Context, protocolName string, address string) sdkmath.Uint

Gets a badge from the store according to the protocolName.

func (Keeper) GetProtocolCollectionsFromStore

func (k Keeper) GetProtocolCollectionsFromStore(ctx sdk.Context) (names []string, addresses []string, collectionIds []sdkmath.Uint)

GetProtocolsFromStore defines a method for returning all badges information by key.

func (Keeper) GetProtocolFromStore

func (k Keeper) GetProtocolFromStore(ctx sdk.Context, protocolName string) (*types.Protocol, bool)

Gets a badge from the store according to the protocolName.

func (Keeper) GetProtocolsFromStore

func (k Keeper) GetProtocolsFromStore(ctx sdk.Context) (protocols []*types.Protocol)

GetProtocolsFromStore defines a method for returning all badges information by key.

func (Keeper) IsBound

func (k Keeper) IsBound(ctx sdk.Context, portID string) bool

IsBound checks if the IBC app module is already bound to the desired port

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) Params

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams set the params

func (Keeper) SetPort

func (k Keeper) SetPort(ctx sdk.Context, portID string)

SetPort sets the portID for the IBC app module. Used in InitGenesis

func (Keeper) SetProtocolCollectionInStore

func (k Keeper) SetProtocolCollectionInStore(ctx sdk.Context, protocolName string, address string, collectionId sdkmath.Uint) error

func (Keeper) SetProtocolInStore

func (k Keeper) SetProtocolInStore(ctx sdk.Context, protocol *types.Protocol) error

func (Keeper) StoreHasProtocolID

func (k Keeper) StoreHasProtocolID(ctx sdk.Context, protocolName string) bool

StoreHasProtocolID determines whether the specified protocolName exists

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL