Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func ParamKeyTable() paramtypes.KeyTable
- type Keeper
- func (k Keeper) BurnFromVotingPool(ctx sdk.Context, amount sdk.Int) error
- func (k Keeper) CreatePost(ctx sdk.Context, vendorID uint32, postID *types.PostID, ...) (post types.Post, err error)
- func (k Keeper) CreateUpvote(ctx sdk.Context, vendorID uint32, postID types.PostID, ...) error
- func (k Keeper) CurationQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k Keeper) DeletePost(ctx sdk.Context, vendorID uint32, postID types.PostID) error
- func (k Keeper) DeleteUpvote(ctx sdk.Context, vendorID uint32, postID types.PostID, upvote types.Upvote) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetCurationQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (vpPairs []types.VPPair)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetPost(ctx sdk.Context, vendorID uint32, postID types.PostID) (post types.Post, found bool, err error)
- func (k Keeper) GetPostID(ctx sdk.Context) (postID uint64)
- func (k Keeper) GetPosts(ctx sdk.Context, vendorID uint32) (posts []types.Post)
- func (k Keeper) GetRewardPool(ctx sdk.Context) (rewardPool authtypes.ModuleAccountI)
- func (k Keeper) GetRewardPoolBalance(ctx sdk.Context) sdk.Coin
- func (k Keeper) GetUpvote(ctx sdk.Context, vendorID uint32, postID types.PostID, curator sdk.AccAddress) (upvote types.Upvote, found bool, err error)
- func (k Keeper) InflateRewardPool(ctx sdk.Context) error
- func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState)
- func (k Keeper) InitializeRewardPool(ctx sdk.Context, funds sdk.Coin) error
- func (k Keeper) InsertCurationQueue(ctx sdk.Context, vendorID uint32, postID types.PostID, ...)
- func (k Keeper) IterateExpiredPosts(ctx sdk.Context, cb func(post types.Post) (stop bool))
- func (k Keeper) IteratePosts(ctx sdk.Context, vendorID uint32, cb func(post types.Post) (stop bool))
- func (k Keeper) IterateUpvotes(ctx sdk.Context, vendorID uint32, postID types.PostID, ...)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MustMarshalPost(post types.Post) []byte
- func (k Keeper) MustMarshalUpvote(upvote types.Upvote) []byte
- func (k Keeper) MustUnmarshalPost(data []byte, post *types.Post)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) Post(c context.Context, req *types.QueryPostRequest) (*types.QueryPostResponse, error)
- func (k Keeper) Posts(c context.Context, req *types.QueryPostsRequest) (*types.QueryPostsResponse, error)
- func (k Keeper) RemoveFromCurationQueue(ctx sdk.Context, curationEndTime time.Time)
- func (k Keeper) SendMatchingReward(ctx sdk.Context, account sdk.AccAddress, matchReward sdk.Dec) (sdk.Coin, error)
- func (k Keeper) SetCurationQueueTimeSlice(ctx sdk.Context, timestamp time.Time, vps []types.VPPair)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPost(ctx sdk.Context, post types.Post)
- func (k Keeper) SetPostID(ctx sdk.Context, postID uint64)
- func (k Keeper) SetUpvote(ctx sdk.Context, upvote types.Upvote, curator sdk.AccAddress)
- func (k Keeper) Upvotes(c context.Context, req *types.QueryUpvotesRequest) (*types.QueryUpvotesResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the curating MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the x/curating store
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryMarshaler, key sdk.StoreKey, ak types.AccountKeeper, bk types.BankKeeper, ps paramtypes.Subspace, ) Keeper
NewKeeper creates a new staking Keeper instance
func (Keeper) BurnFromVotingPool ¶
BurnFromVotingPool burns an amount of CREDITS from the voting pool
func (Keeper) CreatePost ¶
func (k Keeper) CreatePost( ctx sdk.Context, vendorID uint32, postID *types.PostID, bodyHash types.BodyHash, body string, creator, rewardAccount sdk.AccAddress, chainID string, contractAddress sdk.AccAddress, metadata string, parentID *types.PostID, ) (post types.Post, err error)
CreatePost registers a post on-chain and starts the curation period. It can be called from CreateUpvote() when a post doesn't exist yet.
func (Keeper) CreateUpvote ¶
func (k Keeper) CreateUpvote( ctx sdk.Context, vendorID uint32, postID types.PostID, curator, rewardAccount sdk.AccAddress, voteNum int32) error
CreateUpvote performs an upvote operation
func (Keeper) CurationQueueIterator ¶
CurationQueueIterator returns an sdk.Iterator for all the posts in the queue that expire by endTime
func (Keeper) DeletePost ¶
DeletePost removes a post
func (Keeper) DeleteUpvote ¶
func (k Keeper) DeleteUpvote(ctx sdk.Context, vendorID uint32, postID types.PostID, upvote types.Upvote) error
DeleteUpvote removes an upvote
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis exports the curating module state
func (Keeper) GetCurationQueueTimeSlice ¶
func (k Keeper) GetCurationQueueTimeSlice( ctx sdk.Context, timestamp time.Time) (vpPairs []types.VPPair)
GetCurationQueueTimeSlice returns a slice of Vendor/PostID pairs for a give time
func (Keeper) GetPost ¶
func (k Keeper) GetPost( ctx sdk.Context, vendorID uint32, postID types.PostID) (post types.Post, found bool, err error)
GetPost returns post if one exists
func (Keeper) GetRewardPool ¶
func (k Keeper) GetRewardPool(ctx sdk.Context) (rewardPool authtypes.ModuleAccountI)
GetRewardPool returns the reward pool account.
func (Keeper) GetRewardPoolBalance ¶
GetRewardPoolBalance returns the reward pool balance
func (Keeper) GetUpvote ¶
func (k Keeper) GetUpvote( ctx sdk.Context, vendorID uint32, postID types.PostID, curator sdk.AccAddress) (upvote types.Upvote, found bool, err error)
GetUpvote returns an upvote if one exists
func (Keeper) InflateRewardPool ¶
InflateRewardPool process the designated inflation to the reward pool
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState)
InitGenesis initializes the curating module state
func (Keeper) InitializeRewardPool ¶
InitializeRewardPool sets up the reward pool from genesis
func (Keeper) InsertCurationQueue ¶
func (k Keeper) InsertCurationQueue( ctx sdk.Context, vendorID uint32, postID types.PostID, curationEndTime time.Time)
InsertCurationQueue inserts a VPPair into the right timeslot in the curation queue
func (Keeper) IterateExpiredPosts ¶
IterateExpiredPosts iterates over posts that have finished their curation period, and performs a callback fuction.
func (Keeper) IteratePosts ¶
func (k Keeper) IteratePosts(ctx sdk.Context, vendorID uint32, cb func(post types.Post) (stop bool))
IteratePosts iterates over the all the posts by vendor_id and performs a callback function
func (Keeper) IterateUpvotes ¶
func (k Keeper) IterateUpvotes( ctx sdk.Context, vendorID uint32, postID types.PostID, cb func(upvote types.Upvote) (stop bool))
IterateUpvotes performs a callback function for each upvoter on a post
func (Keeper) MustMarshalPost ¶
MustMarshalPost attempts to encode a Post object and returns the raw encoded bytes. It panics on error.
func (Keeper) MustMarshalUpvote ¶
MustMarshalUpvote attempts to encode an Upvote object and returns the raw encoded bytes. It panics on error.
func (Keeper) MustUnmarshalPost ¶
MustUnmarshalPost attempts to decode a Post object and return it. It panics on error.
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params returns module params
func (Keeper) Post ¶
func (k Keeper) Post(c context.Context, req *types.QueryPostRequest) (*types.QueryPostResponse, error)
Post returns a post based on vendor and post id
func (Keeper) Posts ¶
func (k Keeper) Posts(c context.Context, req *types.QueryPostsRequest) (*types.QueryPostsResponse, error)
Posts returns all posts based on vendor
func (Keeper) RemoveFromCurationQueue ¶
RemoveFromCurationQueue will remove an entire VPPair set from the queue
func (Keeper) SendMatchingReward ¶
func (k Keeper) SendMatchingReward( ctx sdk.Context, account sdk.AccAddress, matchReward sdk.Dec) (sdk.Coin, error)
SendMatchingReward sends curator rewards from the protocol reward pool
func (Keeper) SetCurationQueueTimeSlice ¶
func (k Keeper) SetCurationQueueTimeSlice( ctx sdk.Context, timestamp time.Time, vps []types.VPPair)
SetCurationQueueTimeSlice sets a slice of Vendor/PostIDs in the curation queue
func (Keeper) Upvotes ¶
func (k Keeper) Upvotes(c context.Context, req *types.QueryUpvotesRequest) (*types.QueryUpvotesResponse, error)
Upvotes returns all upvotes for a given vendor and post id