txs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxTitleLen       = 200
	MaxDescriptionLen = 1000
)

Variables

Functions

func RegisterCodec

func RegisterCodec(cdc *amino.Codec)

Types

type TxDeposit

type TxDeposit struct {
	ProposalID int64             `json:"proposal_id"` // ID of the proposal
	Depositor  btypes.AccAddress `json:"depositor"`   // Address of the depositor
	Amount     btypes.BigInt     `json:"amount"`      // Amount of QOS to add to the proposal's deposit
}

提议质押

func NewTxDeposit

func NewTxDeposit(proposalID int64, depositor btypes.AccAddress, amount btypes.BigInt) *TxDeposit

func (TxDeposit) CalcGas

func (tx TxDeposit) CalcGas() btypes.BigInt

Tx gas, 0

func (TxDeposit) Exec

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

交易执行

func (TxDeposit) GetGasPayer

func (tx TxDeposit) GetGasPayer() btypes.AccAddress

Gas payer, Depositor

func (TxDeposit) GetSignData

func (tx TxDeposit) GetSignData() (ret []byte)

签名字节

func (TxDeposit) GetSigner

func (tx TxDeposit) GetSigner() []btypes.AccAddress

签名账户, Depositor

func (TxDeposit) ValidateData

func (tx TxDeposit) ValidateData(ctx context.Context) error

数据校验

type TxModifyInflation

type TxModifyInflation struct {
	TxProposal
	TotalAmount      btypes.BigInt         `json:"total_amount"`      // 总发行量
	InflationPhrases mint.InflationPhrases `json:"inflation_phrases"` // 通胀阶段
}

修改通胀提议,已结束和当前通胀阶段不可更改

func NewTxModifyInflation

func NewTxModifyInflation(title, description string, proposer btypes.AccAddress, deposit btypes.BigInt, totalAmount btypes.BigInt, phrases []mint.InflationPhrase) *TxModifyInflation

func (TxModifyInflation) CalcGas

func (tx TxModifyInflation) CalcGas() btypes.BigInt

Tx gas, 0

func (TxModifyInflation) Exec

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

交易执行

func (TxModifyInflation) GetGasPayer

func (tx TxModifyInflation) GetGasPayer() btypes.AccAddress

Gas payer

func (TxModifyInflation) GetSignData

func (tx TxModifyInflation) GetSignData() (ret []byte)

签名字节

func (TxModifyInflation) GetSigner

func (tx TxModifyInflation) GetSigner() []btypes.AccAddress

签名账户, Proposer

func (TxModifyInflation) ValidateData

func (tx TxModifyInflation) ValidateData(ctx context.Context) error

数据检验

func (TxModifyInflation) ValidateInputs added in v0.0.8

func (tx TxModifyInflation) ValidateInputs() error

基础数据检验

type TxParameterChange

type TxParameterChange struct {
	TxProposal               // 基础数据
	Params     []types.Param `json:"params"` // 参数变更
}

参数修改提议

func NewTxParameterChange

func NewTxParameterChange(title, description string, proposer btypes.AccAddress, deposit btypes.BigInt, params []types.Param) *TxParameterChange

func (TxParameterChange) CalcGas

func (tx TxParameterChange) CalcGas() btypes.BigInt

Tx gas, 0

func (TxParameterChange) Exec

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

交易执行

func (TxParameterChange) GetGasPayer

func (tx TxParameterChange) GetGasPayer() btypes.AccAddress

Gas payer

func (TxParameterChange) GetSignData

func (tx TxParameterChange) GetSignData() (ret []byte)

签名字节

func (TxParameterChange) GetSigner

func (tx TxParameterChange) GetSigner() []btypes.AccAddress

签名账户, Proposer

func (TxParameterChange) ValidateData

func (tx TxParameterChange) ValidateData(ctx context.Context) error

数据校验

type TxProposal

type TxProposal struct {
	Title          string             `json:"title"`           //  Title of the proposal
	Description    string             `json:"description"`     //  Description of the proposal
	ProposalType   types.ProposalType `json:"proposal_type"`   //  Type of proposal. Initial set {PlainTextProposal, SoftwareUpgradeProposal}
	Proposer       btypes.AccAddress  `json:"proposer"`        //  Address of the proposer
	InitialDeposit btypes.BigInt      `json:"initial_deposit"` //  Initial deposit paid by sender. Must be strictly positive.
}

文本提议

func NewTxProposal

func NewTxProposal(title, description string, proposer btypes.AccAddress, deposit btypes.BigInt) *TxProposal

func (TxProposal) CalcGas

func (tx TxProposal) CalcGas() btypes.BigInt

Tx gas, 0

func (TxProposal) Exec

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

交易执行

func (TxProposal) GetGasPayer

func (tx TxProposal) GetGasPayer() btypes.AccAddress

Gas payer, Proposal

func (TxProposal) GetSignData

func (tx TxProposal) GetSignData() (ret []byte)

签名字节

func (TxProposal) GetSigner

func (tx TxProposal) GetSigner() []btypes.AccAddress

签名账户, Proposer

func (TxProposal) ValidateData

func (tx TxProposal) ValidateData(ctx context.Context) error

数据校验

func (TxProposal) ValidateInputs added in v0.0.8

func (tx TxProposal) ValidateInputs() error

基础数据校验

type TxSoftwareUpgrade

type TxSoftwareUpgrade struct {
	TxProposal
	Version       string `json:"version"`         // qosd version
	DataHeight    int64  `json:"data_height"`     // data version
	GenesisFile   string `json:"genesis_file"`    // url of genesis file
	GenesisMD5    string `json:"genesis_md5"`     // signature of genesis.json
	ForZeroHeight bool   `json:"for_zero_height"` // restart from zero height
}

软件升级提议

func NewTxSoftwareUpgrade

func NewTxSoftwareUpgrade(title, description string, proposer btypes.AccAddress, deposit btypes.BigInt,
	version string, dataHeight int64, genesisFile string, genesisMd5 string, forZeroHeight bool) *TxSoftwareUpgrade

func (TxSoftwareUpgrade) CalcGas

func (tx TxSoftwareUpgrade) CalcGas() btypes.BigInt

Tx gas, 0

func (TxSoftwareUpgrade) Exec

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

交易执行

func (TxSoftwareUpgrade) GetGasPayer

func (tx TxSoftwareUpgrade) GetGasPayer() btypes.AccAddress

Gas payer, Proposer

func (TxSoftwareUpgrade) GetSignData

func (tx TxSoftwareUpgrade) GetSignData() (ret []byte)

签名字节

func (TxSoftwareUpgrade) GetSigner

func (tx TxSoftwareUpgrade) GetSigner() []btypes.AccAddress

签名账户, Proposer

func (TxSoftwareUpgrade) ValidateData

func (tx TxSoftwareUpgrade) ValidateData(ctx context.Context) error

数据校验

func (TxSoftwareUpgrade) ValidateInputs added in v0.0.8

func (tx TxSoftwareUpgrade) ValidateInputs() error

基础数据校验

type TxTaxUsage

type TxTaxUsage struct {
	TxProposal                    // 基础提议信息
	DestAddress btypes.AccAddress `json:"dest_address"` // 接收账户
	Percent     qtypes.Dec        `json:"percent"`      // 提取比例
}

提取社区费池,从社区非池中提取QOS到指定账户,仅guardian账户可提交此提议

func NewTxTaxUsage

func NewTxTaxUsage(title, description string, proposer btypes.AccAddress, deposit btypes.BigInt, destAddress btypes.AccAddress, percent qtypes.Dec) *TxTaxUsage

func (TxTaxUsage) CalcGas

func (tx TxTaxUsage) CalcGas() btypes.BigInt

Tx gas, 0

func (TxTaxUsage) Exec

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

交易执行

func (TxTaxUsage) GetGasPayer

func (tx TxTaxUsage) GetGasPayer() btypes.AccAddress

Gas payer

func (TxTaxUsage) GetSignData

func (tx TxTaxUsage) GetSignData() (ret []byte)

签名字节

func (TxTaxUsage) GetSigner

func (tx TxTaxUsage) GetSigner() []btypes.AccAddress

签名账户, Proposer

func (TxTaxUsage) ValidateData

func (tx TxTaxUsage) ValidateData(ctx context.Context) error

数据校验

func (TxTaxUsage) ValidateInputs added in v0.0.8

func (tx TxTaxUsage) ValidateInputs() error

数据校验

type TxVote

type TxVote struct {
	ProposalID int64             `json:"proposal_id"` // ID of the proposal
	Voter      btypes.AccAddress `json:"voter"`       //  address of the voter
	Option     types.VoteOption  `json:"option"`      //  option from OptionSet chosen by the voter
}

提议投票

func NewTxVote

func NewTxVote(proposalID int64, voter btypes.AccAddress, option types.VoteOption) *TxVote

func (TxVote) CalcGas

func (tx TxVote) CalcGas() btypes.BigInt

Tx gas, 0

func (TxVote) Exec

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

交易执行

func (TxVote) GetGasPayer

func (tx TxVote) GetGasPayer() btypes.AccAddress

Gas payer, Voter

func (TxVote) GetSignData

func (tx TxVote) GetSignData() (ret []byte)

签名字节

func (TxVote) GetSigner

func (tx TxVote) GetSigner() []btypes.AccAddress

签名账户, Voter

func (TxVote) ValidateData

func (tx TxVote) ValidateData(ctx context.Context) error

数据校验

func (TxVote) ValidateInputs added in v0.0.8

func (tx TxVote) ValidateInputs() error

数据校验

Jump to

Keyboard shortcuts

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