types

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

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 ErrContentTooLarge() sdk.Error

func ErrInvalidAttitude

func ErrInvalidAttitude(a int32) sdk.Error

func ErrInvalidContent

func ErrInvalidContent() sdk.Error

func ErrInvalidContentType

func ErrInvalidContentType(t int8) sdk.Error

func ErrInvalidSymbol

func ErrInvalidSymbol() sdk.Error

func ErrNegativeDonation

func ErrNegativeDonation() sdk.Error

func ErrNegativeReward

func ErrNegativeReward() sdk.Error

func ErrNoSuchAccount

func ErrNoSuchAccount(acc string) sdk.Error

func ErrNoSuchAsset

func ErrNoSuchAsset() sdk.Error

func ErrNoTitle

func ErrNoTitle() sdk.Error

func ErrTitleTooLarge

func ErrTitleTooLarge() sdk.Error

func ParseAttitude

func ParseAttitude(a string) int32

func ParseContentType

func ParseContentType(t string) int8

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Types

type CommentRef

type CommentRef struct {
	ID           uint64         `json:"id"`
	RewardTarget sdk.AccAddress `json:"reward_target"`
	RewardToken  string         `json:"reward_token"`
	RewardAmount int64          `json:"reward_amount"`
	Attitudes    []int32        `json:"attitudes"`
}

type ExpectedAccountKeeper

type ExpectedAccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.Account
}

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 ExpectedDistributionxKeeper

type ExpectedDistributionxKeeper interface {
	DonateToCommunityPool(ctx sdk.Context, fromAddr sdk.AccAddress, amt sdk.Coins) sdk.Error
}

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

Jump to

Keyboard shortcuts

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