Documentation ¶
Index ¶
- type PostManager
- func (pm PostManager) CreatePost(ctx sdk.Context, author linotypes.AccountKey, postID string, ...) sdk.Error
- func (pm PostManager) DeletePost(ctx sdk.Context, permlink linotypes.Permlink) sdk.Error
- func (pm PostManager) DoesPostExist(ctx sdk.Context, permlink linotypes.Permlink) bool
- func (pm PostManager) ExecRewardEvent(ctx sdk.Context, event types.RewardEvent) sdk.Error
- func (pm PostManager) ExportToFile(ctx sdk.Context, cdc *codec.Codec, filepath string) error
- func (pm PostManager) GetComsumptionWindow(ctx sdk.Context) linotypes.MiniDollar
- func (pm PostManager) GetPost(ctx sdk.Context, permlink linotypes.Permlink) (model.Post, sdk.Error)
- func (pm PostManager) IDADonate(ctx sdk.Context, from linotypes.AccountKey, n linotypes.MiniIDA, ...) sdk.Error
- func (pm PostManager) ImportFromFile(ctx sdk.Context, cdc *codec.Codec, filepath string) error
- func (pm PostManager) LinoDonate(ctx sdk.Context, from linotypes.AccountKey, amount linotypes.Coin, ...) sdk.Error
- func (pm PostManager) UpdatePost(ctx sdk.Context, author linotypes.AccountKey, postID, title, content string) sdk.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostManager ¶
type PostManager struct {
// contains filtered or unexported fields
}
func NewPostManager ¶
func NewPostManager(key sdk.StoreKey, am acc.AccountKeeper, gm global.GlobalKeeper, dev dev.DeveloperKeeper, rep rep.ReputationKeeper, price price.PriceKeeper, vote vote.VoteKeeper) PostManager
NewPostManager - create a new post manager
func (PostManager) CreatePost ¶
func (pm PostManager) CreatePost(ctx sdk.Context, author linotypes.AccountKey, postID string, createdBy linotypes.AccountKey, content string, title string) sdk.Error
CreatePost validate and handles CreatePostMsg stateful validation; 1. both author and post id exists. 2. if createdBy is not author, then it must be an app. 3. post's permlink does not exists.
func (PostManager) DeletePost ¶
DeletePost - delete post by author or content censorship stateful validation: 1. permlink exists. 2. post not deleted. Delete does not delete the post in kv store, as that will make `permlink` not permanent. It is marked as deleted, then on deleted posts, 1. manager.DoesPostExist will return false. 2. manager.GetPost will return ErrPermlinkDeleted. 3. manager.CreatePost will return ErrPostAlreadyExist.
func (PostManager) DoesPostExist ¶
DoesPostExist - check if post exist 1. permlink kv exists. 2. post is not marked as deleted.
func (PostManager) ExecRewardEvent ¶
func (pm PostManager) ExecRewardEvent(ctx sdk.Context, event types.RewardEvent) sdk.Error
ExecRewardEvent - execute reward events.
func (PostManager) ExportToFile ¶
Export - to file.
func (PostManager) GetComsumptionWindow ¶ added in v0.6.3
func (pm PostManager) GetComsumptionWindow(ctx sdk.Context) linotypes.MiniDollar
func (PostManager) IDADonate ¶
func (pm PostManager) IDADonate(ctx sdk.Context, from linotypes.AccountKey, n linotypes.MiniIDA, author linotypes.AccountKey, postID string, app, signer linotypes.AccountKey) sdk.Error
IDADonate - handle IDA donation.
func (PostManager) ImportFromFile ¶
Import - from file
func (PostManager) LinoDonate ¶
func (pm PostManager) LinoDonate(ctx sdk.Context, from linotypes.AccountKey, amount linotypes.Coin, author linotypes.AccountKey, postID string, app linotypes.AccountKey) sdk.Error
LinoDonate handles donation using lino. stateful validation: 1. post exits 2. from/to account exists. 3. no self donation. 4. if app is not empty, then developer must exist. 5. amount positive > 0. 6. 9.9% of amount > 0 coin.
func (PostManager) UpdatePost ¶
func (pm PostManager) UpdatePost(ctx sdk.Context, author linotypes.AccountKey, postID, title, content string) sdk.Error
UpdatePost - update post title, content and links. stateful validation: 1. author exist. 2. post exist.