article

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ARTICLE_PRIV_ERR            = "201" //上传者私钥获取地址错误
	ARTICLE_ORIGIN_ERR          = "202" //原作者获取地址错误
	ARTICLE_AUTHOR_SHARE_ERR    = "203" // 作者收入比例出错
	ARTICLE_ORIGIN_SHARE_ERR    = "204" // 原创入比例出错
	ARTICLE_COMMUNITY_SHARE_ERR = "205" // 社区收入比例出错
	ARTICLE_INVESTOR_SHARE_ERR  = "206" // 投资者收入比例出错
	ARTICLE_INVESTOR_DATE_ERR   = "207" // 投资期限出错
	ARTICLE_BUY_DATE_ERR        = "208" // 购买期限比例出错
	ARTICLE_ADDRES_ERR          = "209" // 地址转换错误
	ARTICLE_PRIV_AUTHOR_ERR     = "210" // 非作者本人私钥
	ARTICLE_SENDTX_ERR          = "211" //交易出错

	ARTICLE_QUERY_ERR = "212" //查询跨链结果错误
)

Variables

This section is empty.

Functions

func GetArticle

func GetArticle(cdc *amino.Codec, key string) string

GetArticle process of get Article

func NewArticle

func NewArticle(cdc *amino.Codec, ctx *config.CLIConfig, authorAddress, originalAuthor, articleHash, shareAuthor, shareOriginalAuthor,
	shareCommunity, shareInvestor, endInvestDate, endBuyDate string) string

上传新作品

authoraddress 作者地址(必填) originalAuthor 原创作者地址(为空表示原创) articleHash 作品唯一标识hash shareAuthor 作者收入比例(必填) shareOriginalAuthor 原创收入比例(转载作品必填) shareCommunity 社区收入比例(必填) shareInvestor 投资者收入比例(必填) endInvestDate 投资结束时间(必填) 单位 小时 endBuyDate 广告位购买结果时间(必填) 单位 小时

func NewArticleCmd

func NewArticleCmd(cdc *wire.Codec) *cobra.Command

SendTxCmd will create a send tx and sign it with the given key.

func QueryArticleCmd

func QueryArticleCmd(cdc *wire.Codec) *cobra.Command

Types

type AricleStub

type AricleStub struct {
}

func NewCoinsStub

func NewCoinsStub() AricleStub

func (AricleStub) CustomerQuery

func (cstub AricleStub) CustomerQuery(ctx context.Context, route []string, req abci.RequestQuery) (res []byte, err types.Error)

func (AricleStub) EndBlockNotify

func (astub AricleStub) EndBlockNotify(ctx context.Context)

func (AricleStub) Name

func (cstub AricleStub) Name() string

func (AricleStub) RegisterCdc

func (astub AricleStub) RegisterCdc(cdc *go_amino.Codec)

func (AricleStub) ResultNotify

func (astub AricleStub) ResultNotify(ctx context.Context, txQcpResult interface{}) *types.Result

func (AricleStub) StartX

func (astub AricleStub) StartX(base *baseapp.QstarsBaseApp) error

type ArticleTx

type ArticleTx struct {
	Authoraddress       types.Address //作者地址(必填)
	OriginalAuthor      types.Address //原创作者地址(为空表示原创)
	ArticleHash         string        //作品唯一标识hash
	ShareAuthor         int           //作者收入比例(必填)
	ShareOriginalAuthor int           //原创收入比例(转载作品必填)
	ShareCommunity      int           //社区收入比例(必填)
	ShareInvestor       int           //投资者收入比例(必填)
	InvestHours         int           //可供投资的小时数(必填)
	BuyHours            int           //可供购买广告位的小时数(必填)
	Gas                 types.BigInt
}

func NewArticlesTx

func NewArticlesTx(authoraddress, originalAuthor types.Address, articleHash string, shareAuthor, shareOriginalAuthor,
	shareCommunity, shareInvestor, endInvestDate, endBuyDate int, gas types.BigInt) *ArticleTx

func (*ArticleTx) CalcGas

func (tx *ArticleTx) CalcGas() types.BigInt

func (*ArticleTx) Exec

func (tx *ArticleTx) Exec(ctx context.Context) (result types.Result, crossTxQcp *txs.TxQcp)

执行业务逻辑, crossTxQcp: 需要进行跨链处理的TxQcp。 业务端实现中crossTxQcp只需包含`to` 和 `txStd`

func (*ArticleTx) GetGasPayer

func (tx *ArticleTx) GetGasPayer() types.Address

func (*ArticleTx) GetSignData

func (tx *ArticleTx) GetSignData() (ret []byte)

func (*ArticleTx) GetSigner

func (tx *ArticleTx) GetSigner() []types.Address

func (ArticleTx) Name

func (tx ArticleTx) Name() string

func (*ArticleTx) ValidateData

func (tx *ArticleTx) ValidateData(ctx context.Context) error

Jump to

Keyboard shortcuts

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