types

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultCodeSpace btypes.CodespaceType = "transfer"

	CodeInvalidInput                btypes.CodeType = 201 // 基础数据输入有误
	CodeSenderAccountNotExists      btypes.CodeType = 202 // 转出账户不存在
	CodeSenderAccountCoinsNotEnough btypes.CodeType = 203 // 转出账户余额不足
)

Transfer errors reserve 200 ~ 299.

Variables

View Source
var (
	EventTypeSend           = "send"
	EventTypeReceive        = "receive"
	EventTypeInvariantCheck = types.EventTypeInvariantCheck

	AttributeKeyModule  = "transfer"
	AttributeKeyAddress = "address"
	AttributeKeyQOS     = "qos"
	AttributeKeyQSCs    = "qscs"
	AttributeKeySender  = "sender"
	AttributeKeyHeight  = "height"
)

Functions

func ErrInvalidInput

func ErrInvalidInput(codeSpace btypes.CodespaceType, msg string) btypes.Error

func ErrSenderAccountCoinsNotEnough

func ErrSenderAccountCoinsNotEnough(codeSpace btypes.CodespaceType, msg string) btypes.Error

func ErrSenderAccountNotExists

func ErrSenderAccountNotExists(codeSpace btypes.CodespaceType, msg string) btypes.Error

func ValidateGenesis

func ValidateGenesis(gs GenesisState) error

Types

type GenesisState

type GenesisState struct {
	Accounts []*qtypes.QOSAccount `json:"accounts"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func NewGenesisState

func NewGenesisState(accounts []*qtypes.QOSAccount) GenesisState

type TransItem

type TransItem struct {
	Address btypes.Address `json:"addr"` // 账户地址
	QOS     btypes.BigInt  `json:"qos"`  // QOS
	QSCs    types.QSCs     `json:"qscs"` // QSCs
}

func (TransItem) IsValid

func (item TransItem) IsValid() (bool, error)

valid QSC、QSCs

type TransItems

type TransItems []TransItem

func (TransItems) IsEmpty

func (items TransItems) IsEmpty() bool

empty check

func (TransItems) IsValid

func (items TransItems) IsValid() (bool, error)

not empty and QOS、QSCs

func (TransItems) Match

func (items TransItems) Match(itemsB TransItems) (bool, error)

total QOS、QSCs in items and itemsB are equal

Jump to

Keyboard shortcuts

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