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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxNameLen        = 300
	MaxLinkLen        = 255
	MaxDescriptionLen = 1000

	GasForCreateValidator = int64(1.8*qtypes.UnitQOS) * qtypes.UnitQOSGas  // 1.8 QOS
	GasForModifyValidator = int64(0.18*qtypes.UnitQOS) * qtypes.UnitQOSGas // 0.18 QOS
	GasForRevokeValidator = int64(18*qtypes.UnitQOS) * qtypes.UnitQOSGas   // 18 QOS
)
View Source
var GasForUnbond = int64(0.18*qtypes.UnitQOS) * qtypes.UnitQOSGas // 0.18 QOS

Functions

func RegisterCodec

func RegisterCodec(cdc *amino.Codec)

Types

type TxActiveValidator

type TxActiveValidator struct {
	Owner         btypes.AccAddress `json:"owner"`          // 验证人Owner地址
	ValidatorAddr btypes.ValAddress `json:"validator_addr"` // 验证人地址
	BondTokens    btypes.BigInt     `json:"bond_tokens"`    // 增加绑定Token数量
}

激活验证节点Tx

func NewActiveValidatorTx

func NewActiveValidatorTx(owner btypes.AccAddress, validatorAddr btypes.ValAddress, bondTokens btypes.BigInt) *TxActiveValidator

func (*TxActiveValidator) CalcGas

func (tx *TxActiveValidator) CalcGas() btypes.BigInt

Tx Gas, 0

func (*TxActiveValidator) Exec

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

交易执行

func (*TxActiveValidator) GetGasPayer

func (tx *TxActiveValidator) GetGasPayer() btypes.AccAddress

Gas payer, owner

func (*TxActiveValidator) GetSignData

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

签名字节

func (*TxActiveValidator) GetSigner

func (tx *TxActiveValidator) GetSigner() []btypes.AccAddress

签名账户,owner

func (*TxActiveValidator) ValidateData

func (tx *TxActiveValidator) ValidateData(ctx context.Context) (err error)

数据验证

type TxCreateDelegation

type TxCreateDelegation struct {
	Delegator     btypes.AccAddress `json:"delegator"`      // 委托人
	ValidatorAddr btypes.ValAddress `json:"validator_addr"` // 验证人
	Amount        btypes.BigInt     `json:"amount"`         // 委托QOS数量
	IsCompound    bool              `json:"is_compound"`    // 定期收益是否复投
}

委托Tx

func (*TxCreateDelegation) CalcGas

func (tx *TxCreateDelegation) CalcGas() btypes.BigInt

Tx Gas, 0

func (*TxCreateDelegation) Exec

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

创建或新增委托

func (*TxCreateDelegation) GetGasPayer

func (tx *TxCreateDelegation) GetGasPayer() btypes.AccAddress

Gas payer, delegator

func (*TxCreateDelegation) GetSignData

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

签名字节

func (*TxCreateDelegation) GetSigner

func (tx *TxCreateDelegation) GetSigner() []btypes.AccAddress

签名账户,delegator

func (*TxCreateDelegation) ValidateData

func (tx *TxCreateDelegation) ValidateData(ctx context.Context) (err error)

数据验证

type TxCreateReDelegation

type TxCreateReDelegation struct {
	Delegator         btypes.AccAddress `json:"delegator"`           // 委托人
	FromValidatorAddr btypes.ValAddress `json:"from_validator_addr"` // 原委托验证人
	ToValidatorAddr   btypes.ValAddress `json:"to_validator_addr"`   // 现委托验证人
	Amount            btypes.BigInt     `json:"amount"`              // 委托数量
	RedelegateAll     bool              `json:"redelegate_all"`      // 转委托所有
	Compound          bool              `json:"compound"`            // 复投
}

转委托Tx

func (*TxCreateReDelegation) CalcGas

func (tx *TxCreateReDelegation) CalcGas() btypes.BigInt

Tx Gas, 0

func (*TxCreateReDelegation) Exec

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

交易执行

func (*TxCreateReDelegation) GetGasPayer

func (tx *TxCreateReDelegation) GetGasPayer() btypes.AccAddress

Gas payer, delegator

func (*TxCreateReDelegation) GetSignData

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

签名字节

func (*TxCreateReDelegation) GetSigner

func (tx *TxCreateReDelegation) GetSigner() []btypes.AccAddress

签名账户,delegator

func (*TxCreateReDelegation) ValidateData

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

数据校验

type TxCreateValidator

type TxCreateValidator struct {
	Owner       btypes.AccAddress      `json:"owner"`        // 操作者, self delegator
	ConsPubKey  crypto.PubKey          `json:"cons_pub_key"` // validator公钥
	BondTokens  btypes.BigInt          `json:"bond_tokens"`  // 绑定Token数量
	IsCompound  bool                   `json:"is_compound"`  // 周期收益是否复投
	Description types.Description      `json:"description"`  // 描述信息
	Commission  types.CommissionRates  `json:"commission"`   // 佣金比例
	Delegations []types.DelegationInfo `json:"delegations"`  // 初始委托,仅在iniChainer中执行有效
}

创建验证节点Tx

func NewCreateValidatorTx

func NewCreateValidatorTx(operator btypes.AccAddress, bech32ConPubKey crypto.PubKey, bondTokens btypes.BigInt, isCompound bool, description types.Description, commission types.CommissionRates, delegations []types.DelegationInfo) *TxCreateValidator

func (*TxCreateValidator) CalcGas

func (tx *TxCreateValidator) CalcGas() btypes.BigInt

Tx Gas, 1.8QOS

func (*TxCreateValidator) Exec

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

交易执行

func (*TxCreateValidator) GetGasPayer

func (tx *TxCreateValidator) GetGasPayer() btypes.AccAddress

Gas payer, operator

func (*TxCreateValidator) GetSignData

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

签名字节

func (*TxCreateValidator) GetSigner

func (tx *TxCreateValidator) GetSigner() []btypes.AccAddress

签名账户,operator

func (*TxCreateValidator) ValidateData

func (tx *TxCreateValidator) ValidateData(ctx context.Context) (err error)

数据校验

func (*TxCreateValidator) ValidateInputs added in v0.0.8

func (tx *TxCreateValidator) ValidateInputs() (err error)

基础数据校验

type TxModifyCompound

type TxModifyCompound struct {
	Delegator     btypes.AccAddress `json:"delegator"`      // 委托人
	ValidatorAddr btypes.ValAddress `json:"validator_addr"` // 验证者
	IsCompound    bool              `json:"is_compound"`    // 周期收益是否复投: 收益发放周期内多次修改,仅最后一次生效
}

修改单复利Tx

func (*TxModifyCompound) CalcGas

func (tx *TxModifyCompound) CalcGas() btypes.BigInt

Tx Gas, 0

func (*TxModifyCompound) Exec

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

交易执行

func (*TxModifyCompound) GetGasPayer

func (tx *TxModifyCompound) GetGasPayer() btypes.AccAddress

Gas payer, delegator

func (*TxModifyCompound) GetSignData

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

签名字节

func (*TxModifyCompound) GetSigner

func (tx *TxModifyCompound) GetSigner() []btypes.AccAddress

签名账户,delegator

func (*TxModifyCompound) ValidateData

func (tx *TxModifyCompound) ValidateData(ctx context.Context) (err error)

数据校验

type TxModifyValidator

type TxModifyValidator struct {
	Owner          btypes.AccAddress `json:"owner"`           // 验证人Owner地址
	ValidatorAddr  btypes.ValAddress `json:"validator_addr"`  // 验证人地址
	Description    types.Description `json:"description"`     // 描述信息
	CommissionRate *qtypes.Dec       `json:"commission_rate"` // 佣金比例
}

修改验证节点基础信息Tx

func NewModifyValidatorTx

func NewModifyValidatorTx(owner btypes.AccAddress, validatorAddr btypes.ValAddress, description types.Description, commissionRate *qtypes.Dec) *TxModifyValidator

func (*TxModifyValidator) CalcGas

func (tx *TxModifyValidator) CalcGas() btypes.BigInt

Tx Gas, 0.18QOS

func (*TxModifyValidator) Exec

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

交易执行

func (*TxModifyValidator) GetGasPayer

func (tx *TxModifyValidator) GetGasPayer() btypes.AccAddress

Gas payer,

func (*TxModifyValidator) GetSignData

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

签名字节

func (*TxModifyValidator) GetSigner

func (tx *TxModifyValidator) GetSigner() []btypes.AccAddress

签名账户

func (*TxModifyValidator) ValidateData

func (tx *TxModifyValidator) ValidateData(ctx context.Context) (err error)

数据校验

func (*TxModifyValidator) ValidateInputs added in v0.0.8

func (tx *TxModifyValidator) ValidateInputs() (err error)

基础数据校验

type TxRevokeValidator

type TxRevokeValidator struct {
	Owner         btypes.AccAddress `json:"owner"`          // 验证人Owner地址
	ValidatorAddr btypes.ValAddress `json:"validator_addr"` // 验证人地址
}

撤销验证节点Tx

func NewRevokeValidatorTx

func NewRevokeValidatorTx(owner btypes.AccAddress, validatorAddr btypes.ValAddress) *TxRevokeValidator

func (*TxRevokeValidator) CalcGas

func (tx *TxRevokeValidator) CalcGas() btypes.BigInt

Tx Gas, 18QOS

func (*TxRevokeValidator) Exec

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

交易执行

func (*TxRevokeValidator) GetGasPayer

func (tx *TxRevokeValidator) GetGasPayer() btypes.AccAddress

Gas payer, owenr

func (*TxRevokeValidator) GetSignData

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

签名字节

func (*TxRevokeValidator) GetSigner

func (tx *TxRevokeValidator) GetSigner() []btypes.AccAddress

签名账户,owenr

func (*TxRevokeValidator) ValidateData

func (tx *TxRevokeValidator) ValidateData(ctx context.Context) (err error)

数据校验

type TxUnbondDelegation

type TxUnbondDelegation struct {
	Delegator     btypes.AccAddress `json:"delegator"`      // 委托人
	ValidatorAddr btypes.ValAddress `json:"validator_addr"` // 验证者
	UnbondAmount  btypes.BigInt     `json:"unbond_amount"`  // unbond数量
	UnbondAll     bool              `json:"unbond_all"`     // 是否全部解绑, 为true时覆盖UnbondAmount
}

解除委托Tx

func (*TxUnbondDelegation) CalcGas

func (tx *TxUnbondDelegation) CalcGas() btypes.BigInt

Tx Gas, 0.18QOS

func (*TxUnbondDelegation) Exec

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

交易执行

func (*TxUnbondDelegation) GetGasPayer

func (tx *TxUnbondDelegation) GetGasPayer() btypes.AccAddress

Gas payer, delegator

func (*TxUnbondDelegation) GetSignData

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

签名字节

func (*TxUnbondDelegation) GetSigner

func (tx *TxUnbondDelegation) GetSigner() []btypes.AccAddress

签名账户,delegator

func (*TxUnbondDelegation) ValidateData

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

数据校验

Jump to

Keyboard shortcuts

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