Documentation ¶
Index ¶
- Constants
- Variables
- func ErrContentTooLarge() sdk.Error
- func ErrInvalidAttitude(a int32) sdk.Error
- func ErrInvalidContent() sdk.Error
- func ErrInvalidContentType(t int8) sdk.Error
- func ErrInvalidSymbol() sdk.Error
- func ErrNegativeDonation() sdk.Error
- func ErrNegativeReward() sdk.Error
- func ErrNoSuchAccount(acc string) sdk.Error
- func ErrNoSuchAsset() sdk.Error
- func ErrNoTitle() sdk.Error
- func ErrTitleTooLarge() sdk.Error
- func ParseAttitude(a string) int32
- func ParseContentType(t string) int8
- func RegisterCodec(cdc *codec.Codec)
- type CommentRef
- type ExpectedAccountKeeper
- type ExpectedAssetStatusKeeper
- type ExpectedBankxKeeper
- type ExpectedDistributionxKeeper
- type MsgCommentToken
- func (msg MsgCommentToken) GetSignBytes() []byte
- func (msg MsgCommentToken) GetSigners() []sdk.AccAddress
- func (msg MsgCommentToken) Route() string
- func (msg *MsgCommentToken) SetAccAddress(addr sdk.AccAddress)
- func (msg MsgCommentToken) Type() string
- func (msg MsgCommentToken) ValidateBasic() sdk.Error
- type TokenComment
Constants ¶
View Source
const ( CodeSpaceComment sdk.CodespaceType = "comment" // 901 ~ 999 CodeInvalidSymbol sdk.CodeType = 901 CodeNegativeDonation sdk.CodeType = 902 CodeNoTitle sdk.CodeType = 903 CodeInvalidContentType sdk.CodeType = 904 CodeInvalidContent sdk.CodeType = 905 CodeContentTooLarge sdk.CodeType = 906 CodeInvalidAttitude sdk.CodeType = 907 CodeNegativeReward sdk.CodeType = 908 CodeNoSuchAsset sdk.CodeType = 909 CodeTitleTooLarge sdk.CodeType = 910 CodeNoSuchAccount sdk.CodeType = 911 CodeMarshalFailed sdk.CodeType = 914 )
View Source
const ( // Query // ModuleName is the name of the module ModuleName = "comment" // StoreKey is string representation of the store key for asset StoreKey = ModuleName // RouterKey is the message route for asset RouterKey = ModuleName // QuerierRoute is the querier route for asset QuerierRoute = ModuleName DefaultParamspace = ModuleName // Kafka topic name Topic = ModuleName )
View Source
const ( TokenCommentKey = "token_comment" HanziLengthForLZ4 = 512 MaxContentSize = 16 * 1024 MaxTitleSize = 256 )
RouterKey is the name of the market module
View Source
const ( IPFS int8 = 0 Magnet int8 = 1 HTTP int8 = 2 UTF8Text int8 = 3 ShortHanzi int8 = 4 ShortHanziLZ4 int8 = 5 RawBytes int8 = 6 Like int32 = 50 Dislike int32 = 51 Laugh int32 = 52 Cry int32 = 53 Angry int32 = 54 Surprise int32 = 55 Heart int32 = 56 Sweat int32 = 57 Speechless int32 = 58 Favorite int32 = 59 Condolences int32 = 60 )
Variables ¶
View Source
var (
ModuleCdc = codec.New()
)
Functions ¶
func ErrContentTooLarge ¶
func ErrInvalidAttitude ¶
func ErrInvalidContent ¶
func ErrInvalidContentType ¶
func ErrInvalidSymbol ¶
func ErrNegativeDonation ¶
func ErrNegativeReward ¶
func ErrNoSuchAccount ¶
func ErrNoSuchAsset ¶
func ErrNoTitle ¶
func ErrTitleTooLarge ¶
func ParseAttitude ¶
func ParseContentType ¶
func RegisterCodec ¶
Types ¶
type CommentRef ¶
type ExpectedAccountKeeper ¶
type ExpectedAssetStatusKeeper ¶
type ExpectedAssetStatusKeeper interface {
IsTokenExists(ctx sdk.Context, denom string) bool // check whether there is a coin named "denom"
}
Asset Keeper will implement the interface
type ExpectedBankxKeeper ¶
type ExpectedBankxKeeper interface {
SendCoins(ctx sdk.Context, from sdk.AccAddress, to sdk.AccAddress, amt sdk.Coins) sdk.Error // to tranfer coins
}
Bankx Keeper will implement the interface
type MsgCommentToken ¶
type MsgCommentToken struct { Sender sdk.AccAddress `json:"sender"` Token string `json:"token"` Donation int64 `json:"donation"` Title string `json:"title"` Content []byte `json:"content"` ContentType int8 `json:"content_type"` References []CommentRef `json:"references"` }
func NewMsgCommentToken ¶
func NewMsgCommentToken( sender sdk.AccAddress, token string, donation int64, title string, contentStr string, contentType int8, references []CommentRef) *MsgCommentToken
func (MsgCommentToken) GetSignBytes ¶
func (msg MsgCommentToken) GetSignBytes() []byte
func (MsgCommentToken) GetSigners ¶
func (msg MsgCommentToken) GetSigners() []sdk.AccAddress
func (MsgCommentToken) Route ¶
func (msg MsgCommentToken) Route() string
func (*MsgCommentToken) SetAccAddress ¶
func (msg *MsgCommentToken) SetAccAddress(addr sdk.AccAddress)
func (MsgCommentToken) Type ¶
func (msg MsgCommentToken) Type() string
func (MsgCommentToken) ValidateBasic ¶
func (msg MsgCommentToken) ValidateBasic() sdk.Error
type TokenComment ¶
type TokenComment struct { ID uint64 `json:"id"` Height int64 `json:"height"` Sender sdk.AccAddress `json:"sender"` Token string `json:"token"` Donation int64 `json:"donation"` Title string `json:"title"` Content string `json:"content"` ContentType int8 `json:"content_type"` References []CommentRef `json:"references"` }
func NewTokenComment ¶
func NewTokenComment(msg *MsgCommentToken, id uint64, height int64) *TokenComment
Click to show internal directories.
Click to hide internal directories.