keeper

package
v0.0.0-...-b8f0a8d Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetItemIDBytes

func GetItemIDBytes(id uint64) []byte

GetItemIDBytes returns the byte representation of the ID

func GetItemIDFromBytes

func GetItemIDFromBytes(bz []byte) uint64

GetItemIDFromBytes returns ID in uint64 format from a byte array

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 sdk.StoreKey,

) *Keeper

func (Keeper) AppendItem

func (k Keeper) AppendItem(
	ctx sdk.Context,
	item types.Item,
) uint64

AppendItem appends a item in the store with a new id and update the count

func (Keeper) GetAllItem

func (k Keeper) GetAllItem(ctx sdk.Context) (list []types.Item)

GetAllItem returns all item

func (Keeper) GetItem

func (k Keeper) GetItem(ctx sdk.Context, id uint64) (val types.Item, found bool)

GetItem returns a item from its id

func (Keeper) GetItemCount

func (k Keeper) GetItemCount(ctx sdk.Context) uint64

GetItemCount get the total number of item

func (Keeper) Logger

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

func (Keeper) RemoveItem

func (k Keeper) RemoveItem(ctx sdk.Context, id uint64)

RemoveItem removes a item from the store

func (Keeper) SetItem

func (k Keeper) SetItem(ctx sdk.Context, item types.Item)

SetItem set a specific item in the store

func (Keeper) SetItemCount

func (k Keeper) SetItemCount(ctx sdk.Context, count uint64)

SetItemCount set the total number of item

func (Keeper) Transfer

func (k Keeper) Transfer(ctx sdk.Context, id uint64, newOwner sdk.AccAddress) bool

Jump to

Keyboard shortcuts

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