keeper

package
v1.4.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	QueryPost       = "post"
	QueryUser       = "user"
	QueryModerators = "moderators"
	QueryFollowees  = "followees"
)

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier creates a new querier for community clients.

Types

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace params.Subspace, tokens TokenKeeper) Keeper

NewKeeper creates new instances of the community Keeper

func (Keeper) CreatePost

func (k Keeper) CreatePost(ctx sdk.Context, p types.Post)

CreatePost creates new post. Keeper's key is joined owner and uuid.

func (Keeper) DeleteLike added in v1.3.7

func (k Keeper) DeleteLike(ctx sdk.Context, l types.Like)

func (Keeper) DeletePost

func (k Keeper) DeletePost(ctx sdk.Context, owner sdk.AccAddress, id uuid.UUID)

DeletePost deletes the post from keeper.

func (Keeper) Follow added in v1.0.3

func (k Keeper) Follow(ctx sdk.Context, who, whom sdk.Address)

func (Keeper) GetFollowees added in v1.0.3

func (k Keeper) GetFollowees(ctx sdk.Context, who sdk.Address) []sdk.Address

func (Keeper) GetLikeByKey

func (k Keeper) GetLikeByKey(ctx sdk.Context, key []byte) types.Like

GetLikeByKey returns entire like by keeper's key.

func (Keeper) GetLikesIterator

func (k Keeper) GetLikesIterator(ctx sdk.Context) sdk.Iterator

GetLikesIterator returns an iterator over all likes

func (Keeper) GetParams added in v1.4.0

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

GetParams gets the community module's parameters.

func (Keeper) GetPostByKey

func (k Keeper) GetPostByKey(ctx sdk.Context, key []byte) types.Post

GetPostByKey returns entire post by keeper's key.

func (Keeper) GetPostsIterator

func (k Keeper) GetPostsIterator(ctx sdk.Context) sdk.Iterator

GetPostsIterator returns an iterator over all posts

func (Keeper) IterateFollowers added in v1.0.3

func (k Keeper) IterateFollowers(ctx sdk.Context, cb func(who, whom sdk.Address) (stop bool))

IterateFollowers provide iterator over all followers

func (*Keeper) ResetAccount added in v1.3.4

func (k *Keeper) ResetAccount(ctx sdk.Context, owner sdk.AccAddress)

func (Keeper) SetLike

func (k Keeper) SetLike(ctx sdk.Context, l types.Like)

func (Keeper) SetParams added in v1.4.0

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

SetParams sets the community module's parameters.

func (Keeper) Unfollow added in v1.0.3

func (k Keeper) Unfollow(ctx sdk.Context, who, whom sdk.Address)

type TokenKeeper

type TokenKeeper interface {
	AddTokens(ctx sdk.Context, owner sdk.AccAddress, amount sdk.Int)
	GetBalance(ctx sdk.Context, owner sdk.AccAddress) sdk.Int
}

Jump to

Keyboard shortcuts

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