approve

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildApproveKey

func BuildApproveKey(from string, to string) []byte

func GetApproveMapperStoreKey

func GetApproveMapperStoreKey() string

func RegisterCodec

func RegisterCodec(cdc *amino.Codec)

Types

type Approve

type Approve struct {
	From btypes.Address `json:"from"` // 授权账号
	To   btypes.Address `json:"to"`   // 被授权账号
	QOS  btypes.BigInt  `json:"qos"`  // QOS
	QSCs types.QSCs     `json:"qscs"` // QSCs
}

授权 Common 结构

func NewApprove

func NewApprove(from btypes.Address, to btypes.Address, qos btypes.BigInt, qscs types.QSCs) Approve

func (Approve) CalcGas

func (tx Approve) CalcGas() btypes.BigInt

Gas TODO

func (Approve) Equals

func (tx Approve) Equals(approve Approve) bool

重写Equals

func (Approve) GetGasPayer

func (tx Approve) GetGasPayer() btypes.Address

Gas Payer 授权账号,使用授权:被授权账号

func (Approve) GetSignData

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

签名字节

func (Approve) GetSigner

func (tx Approve) GetSigner() []btypes.Address

签名账号:授权账号,使用授权签名者:被授权账号

func (Approve) IsGT

func (tx Approve) IsGT(qos btypes.BigInt, qscs types.QSCs) bool

是否大于

func (Approve) IsGTE

func (tx Approve) IsGTE(qos btypes.BigInt, qscs types.QSCs) bool

是否大于等于

func (Approve) IsNotNegative

func (tx Approve) IsNotNegative() bool

是否为非负值

func (Approve) IsPositive

func (tx Approve) IsPositive() bool

是否为正值

func (Approve) Minus

func (tx Approve) Minus(qos btypes.BigInt, qscs types.QSCs) (a Approve)

Minus

func (Approve) Negative

func (tx Approve) Negative() (a Approve)

返回相反值

func (Approve) Plus

func (tx Approve) Plus(qos btypes.BigInt, qscs types.QSCs) (a Approve)

Plus

func (Approve) String

func (tx Approve) String() string

输出字符串

func (Approve) ValidateData

func (tx Approve) ValidateData(ctx context.Context) bool

基础数据校验 1.From,To不为空 2.QOS、QscList内币值大于0 3.QscList内币种不能重复,不能为qos(大小写不敏感)

type ApproveCancelTx

type ApproveCancelTx struct {
	From btypes.Address `json:"from"` // 授权账号
	To   btypes.Address `json:"to"`   // 被授权账号
}

取消授权 Tx

func (ApproveCancelTx) CalcGas

func (tx ApproveCancelTx) CalcGas() btypes.BigInt

Gas TODO

func (ApproveCancelTx) Exec

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

func (ApproveCancelTx) GetGasPayer

func (tx ApproveCancelTx) GetGasPayer() btypes.Address

Gas Payer:被授权账号

func (ApproveCancelTx) GetSignData

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

签名字节

func (ApproveCancelTx) GetSigner

func (tx ApproveCancelTx) GetSigner() []btypes.Address

签名账号:被授权账号

func (ApproveCancelTx) ValidateData

func (tx ApproveCancelTx) ValidateData(ctx context.Context) bool

type ApproveCreateTx

type ApproveCreateTx struct {
	Approve
}

创建授权

func (ApproveCreateTx) Exec

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

func (ApproveCreateTx) ValidateData

func (tx ApproveCreateTx) ValidateData(ctx context.Context) bool

type ApproveDecreaseTx

type ApproveDecreaseTx struct {
	Approve
}

减少授权

func (ApproveDecreaseTx) Exec

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

func (ApproveDecreaseTx) ValidateData

func (tx ApproveDecreaseTx) ValidateData(ctx context.Context) bool

type ApproveIncreaseTx

type ApproveIncreaseTx struct {
	Approve
}

增加授权

func (ApproveIncreaseTx) Exec

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

func (ApproveIncreaseTx) ValidateData

func (tx ApproveIncreaseTx) ValidateData(ctx context.Context) bool

type ApproveMapper

type ApproveMapper struct {
	*mapper.BaseMapper
}

func NewApproveMapper

func NewApproveMapper() *ApproveMapper

func (*ApproveMapper) Copy

func (mapper *ApproveMapper) Copy() mapper.IMapper

func (*ApproveMapper) DeleteApprove

func (mapper *ApproveMapper) DeleteApprove(from btypes.Address, to btypes.Address) error

删除授权

func (*ApproveMapper) GetApprove

func (mapper *ApproveMapper) GetApprove(from btypes.Address, to btypes.Address) (Approve, bool)

获取授权

func (*ApproveMapper) SaveApprove

func (mapper *ApproveMapper) SaveApprove(approve Approve) error

保存授权

type ApproveUseTx

type ApproveUseTx struct {
	Approve
}

使用授权

func (ApproveUseTx) Exec

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

func (ApproveUseTx) GetGasPayer

func (tx ApproveUseTx) GetGasPayer() btypes.Address

func (ApproveUseTx) GetSigner

func (tx ApproveUseTx) GetSigner() []btypes.Address

func (ApproveUseTx) ValidateData

func (tx ApproveUseTx) ValidateData(ctx context.Context) bool

Jump to

Keyboard shortcuts

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