Documentation ¶
Index ¶
Constants ¶
const ( // ModuleName is the name of the module ModuleName = "community" // StoreKey to be used when creating the KVStore StoreKey = ModuleName // RouterKey to be used for routing msgs RouterKey = ModuleName // QuerierRoute to be used for querierer msgs QuerierRoute = ModuleName FlagModeratorAddr = "community-moderator-addr" )
Variables ¶
var ( PostPrefix = []byte{0x00} // prefix for keys that store posts LikePrefix = []byte{0x01} // prefix for keys that store likes )
Key prefixes
var ModuleCdc = codec.New()
ModuleCdc is the codec for the module
Functions ¶
func IsPreviewImageValid ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on codec
Types ¶
type Like ¶
type Like struct { Owner sdk.AccAddress `json:"owner"` PostOwner sdk.AccAddress `json:"postOwner"` PostUUID uuid.UUID `json:"postUuid"` Weight LikeWeight `json:"weight"` }
type LikeWeight ¶
type LikeWeight int8
const ( LikeWeightUp LikeWeight = 1 LikeWeightZero LikeWeight = 0 LikeWeightDown LikeWeight = -1 )
type MsgCreatePost ¶
type MsgCreatePost struct { UUID string `json:"uuid"` Owner sdk.AccAddress `json:"owner"` Title string `json:"title"` Category Category `json:"category"` PreviewImage string `json:"previewImage"` Text string `json:"text"` }
MsgCreatePost defines a CreatePost message
func NewMsgCreatePost ¶
func NewMsgCreatePost(title string, category Category, previewImage string, text string, owner sdk.AccAddress) MsgCreatePost
NewMsgCreatePost is a constructor function for MsgCreatePost
func (MsgCreatePost) GetSignBytes ¶
func (msg MsgCreatePost) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgCreatePost) GetSigners ¶
func (msg MsgCreatePost) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgCreatePost) Route ¶
func (msg MsgCreatePost) Route() string
Route should return the name of the module
func (MsgCreatePost) ValidateBasic ¶
func (msg MsgCreatePost) ValidateBasic() error
ValidateBasic runs stateless checks on the message
type MsgDeletePost ¶
type MsgDeletePost struct { PostUUID string `json:"postUUID"` PostOwner sdk.AccAddress `json:"postOwner"` Owner sdk.AccAddress `json:"owner"` }
MsgDeletePost defines a DeletePost message
func NewMsgDeletePost ¶
func NewMsgDeletePost(owner sdk.AccAddress, postUUID uuid.UUID, postOwner sdk.AccAddress) MsgDeletePost
NewMsgDeletePost is a constructor function for MsgDeletePost
func (MsgDeletePost) GetSignBytes ¶
func (msg MsgDeletePost) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgDeletePost) GetSigners ¶
func (msg MsgDeletePost) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgDeletePost) Route ¶
func (msg MsgDeletePost) Route() string
Route should return the name of the module
func (MsgDeletePost) ValidateBasic ¶
func (msg MsgDeletePost) ValidateBasic() error
ValidateBasic runs stateless checks on the message
type MsgSetLike ¶
type MsgSetLike struct { PostOwner sdk.AccAddress `json:"postOwner"` PostUUID string `json:"postUuid"` Owner sdk.AccAddress `json:"owner"` Weight LikeWeight `json:"weight"` }
MsgSetLike defines a SetLike message
func NewMsgSetLike ¶
func NewMsgSetLike(postOwner sdk.AccAddress, postUUID uuid.UUID, owner sdk.AccAddress, weight LikeWeight) MsgSetLike
NewMsgSetLike is a constructor function for MsgSetLike
func (MsgSetLike) GetSignBytes ¶
func (msg MsgSetLike) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgSetLike) GetSigners ¶
func (msg MsgSetLike) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgSetLike) Route ¶
func (msg MsgSetLike) Route() string
Route should return the name of the module
func (MsgSetLike) ValidateBasic ¶
func (msg MsgSetLike) ValidateBasic() error
ValidateBasic runs stateless checks on the message
type Post ¶
type Post struct { UUID uuid.UUID `json:"uuid"` Owner sdk.AccAddress `json:"owner"` Title string `json:"title"` PreviewImage string `json:"previewImage"` Category Category `json:"category"` Text string `json:"text"` LikesCount uint32 `json:"likesCount"` DislikesCount uint32 `json:"dislikesCount"` PDV sdk.Int `json:"pdv"` CreatedAt uint64 `json:"createdAt"` }