approve

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 Imports: 14 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) error

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

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 TxCancelApprove added in v0.0.2

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

取消授权 Tx

func (TxCancelApprove) CalcGas added in v0.0.2

func (tx TxCancelApprove) CalcGas() btypes.BigInt

Gas TODO

func (TxCancelApprove) Exec added in v0.0.2

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

func (TxCancelApprove) GetGasPayer added in v0.0.2

func (tx TxCancelApprove) GetGasPayer() btypes.Address

Gas Payer:被授权账号

func (TxCancelApprove) GetSignData added in v0.0.2

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

签名字节

func (TxCancelApprove) GetSigner added in v0.0.2

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

签名账号:被授权账号

func (TxCancelApprove) ValidateData added in v0.0.2

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

type TxCreateApprove added in v0.0.2

type TxCreateApprove struct {
	Approve
}

创建授权

func (TxCreateApprove) Exec added in v0.0.2

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

func (TxCreateApprove) ValidateData added in v0.0.2

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

type TxDecreaseApprove added in v0.0.2

type TxDecreaseApprove struct {
	Approve
}

减少授权

func (TxDecreaseApprove) Exec added in v0.0.2

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

func (TxDecreaseApprove) ValidateData added in v0.0.2

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

type TxIncreaseApprove added in v0.0.2

type TxIncreaseApprove struct {
	Approve
}

增加授权

func (TxIncreaseApprove) Exec added in v0.0.2

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

func (TxIncreaseApprove) ValidateData added in v0.0.2

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

type TxUseApprove added in v0.0.2

type TxUseApprove struct {
	Approve
}

使用授权

func (TxUseApprove) Exec added in v0.0.2

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

func (TxUseApprove) GetGasPayer added in v0.0.2

func (tx TxUseApprove) GetGasPayer() btypes.Address

func (TxUseApprove) GetSigner added in v0.0.2

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

func (TxUseApprove) ValidateData added in v0.0.2

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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