Documentation ¶
Index ¶
- Constants
- func BuildQSCKey(qscName string) []byte
- func BuildQSCKeyPrefix() []byte
- func ErrBankerNotExists(codeSpace btypes.CodespaceType, msg string) btypes.Error
- func ErrCreatorNotExists(codeSpace btypes.CodespaceType, msg string) btypes.Error
- func ErrInvalidInitAccounts(codeSpace btypes.CodespaceType, msg string) btypes.Error
- func ErrInvalidInput(codeSpace btypes.CodespaceType, msg string) btypes.Error
- func ErrInvalidQSCCA(codeSpace btypes.CodespaceType, msg string) btypes.Error
- func ErrQSCExists(codeSpace btypes.CodespaceType, msg string) btypes.Error
- func ErrQSCNotExists(codeSpace btypes.CodespaceType, msg string) btypes.Error
- func ErrWrongQSCCA(codeSpace btypes.CodespaceType, msg string) btypes.Error
- func InitGenesis(ctx context.Context, data GenesisState)
- func RegisterCodec(cdc *amino.Codec)
- type GenesisState
- type QSCMapper
- func (mapper *QSCMapper) Copy() mapper.IMapper
- func (mapper *QSCMapper) Exists(qscName string) bool
- func (mapper *QSCMapper) GetQSCRootCA() crypto.PubKey
- func (mapper *QSCMapper) GetQSCs() []types.QSCInfo
- func (mapper *QSCMapper) GetQsc(qscName string) (qscinfo *types.QSCInfo)
- func (mapper *QSCMapper) SaveQsc(qscInfo *types.QSCInfo)
- func (mapper *QSCMapper) SetQSCRootCA(pubKey crypto.PubKey)
- type TxCreateQSC
- func (tx TxCreateQSC) CalcGas() btypes.BigInt
- func (tx TxCreateQSC) Exec(ctx context.Context) (result btypes.Result, crossTxQcp *txs.TxQcp)
- func (tx TxCreateQSC) GetGasPayer() btypes.Address
- func (tx TxCreateQSC) GetSignData() (ret []byte)
- func (tx TxCreateQSC) GetSigner() []btypes.Address
- func (tx TxCreateQSC) ValidateData(ctx context.Context) error
- type TxIssueQSC
- func (tx TxIssueQSC) CalcGas() btypes.BigInt
- func (tx TxIssueQSC) Exec(ctx context.Context) (result btypes.Result, crossTxQcp *txs.TxQcp)
- func (tx TxIssueQSC) GetGasPayer() btypes.Address
- func (tx TxIssueQSC) GetSignData() (ret []byte)
- func (tx TxIssueQSC) GetSigner() []btypes.Address
- func (tx TxIssueQSC) ValidateData(ctx context.Context) error
Constants ¶
View Source
const ( DefaultCodeSpace btypes.CodespaceType = "qsc" CodeInvalidInput btypes.CodeType = 301 // 信息有误 CodeInvalidQSCCA btypes.CodeType = 302 // 无效证书 CodeWrongQSCCA btypes.CodeType = 303 // 证书有误 CodeInvalidInitAccounts btypes.CodeType = 304 // 散币账户币种币值有误 CodeCreatorNotExists btypes.CodeType = 305 // 创建账户不存在 CodeQSCExists btypes.CodeType = 306 // QSC已存在 CodeQSCNotExists btypes.CodeType = 307 // QSC不存在 CodeBankerNotExists btypes.CodeType = 308 // Banker账户不存在 )
QSC errors reserve 300 ~ 399.
View Source
const ( QSCMapperName = "qsc" QSCKey = "qsc/[%s]" QSCRootCAKey = "rootca" )
View Source
const ( MaxDescriptionLen = 1000 MaxQSCNameLen = 8 )
Variables ¶
This section is empty.
Functions ¶
func BuildQSCKey ¶
func BuildQSCKeyPrefix ¶
func BuildQSCKeyPrefix() []byte
func ErrBankerNotExists ¶
func ErrBankerNotExists(codeSpace btypes.CodespaceType, msg string) btypes.Error
func ErrCreatorNotExists ¶
func ErrCreatorNotExists(codeSpace btypes.CodespaceType, msg string) btypes.Error
func ErrInvalidInitAccounts ¶
func ErrInvalidInitAccounts(codeSpace btypes.CodespaceType, msg string) btypes.Error
func ErrInvalidInput ¶
func ErrInvalidInput(codeSpace btypes.CodespaceType, msg string) btypes.Error
func ErrInvalidQSCCA ¶
func ErrInvalidQSCCA(codeSpace btypes.CodespaceType, msg string) btypes.Error
func ErrQSCExists ¶
func ErrQSCExists(codeSpace btypes.CodespaceType, msg string) btypes.Error
func ErrQSCNotExists ¶
func ErrQSCNotExists(codeSpace btypes.CodespaceType, msg string) btypes.Error
func ErrWrongQSCCA ¶
func ErrWrongQSCCA(codeSpace btypes.CodespaceType, msg string) btypes.Error
func InitGenesis ¶
func InitGenesis(ctx context.Context, data GenesisState)
func RegisterCodec ¶
func RegisterCodec(cdc *amino.Codec)
Types ¶
type GenesisState ¶
type GenesisState struct { RootPubKey crypto.PubKey `json:"ca_root_pub_key"` QSCs []types.QSCInfo `json:"qscs"` }
func ExportGenesis ¶
func ExportGenesis(ctx context.Context) GenesisState
func NewGenesisState ¶
func NewGenesisState(pubKey crypto.PubKey, qscs []types.QSCInfo) GenesisState
type QSCMapper ¶
type QSCMapper struct {
*mapper.BaseMapper
}
func NewQSCMapper ¶
func NewQSCMapper() *QSCMapper
type TxCreateQSC ¶
type TxCreateQSC struct { Creator btypes.Address `json:"creator"` //QSC创建账户 Extrate string `json:"extrate"` //qcs:qos汇率(amino不支持binary形式的浮点数序列化,精度同qos erc20 [.0000]) QSCCA *cert.Certificate `json:"qsc_crt"` //CA信息 Description string `json:"description"` //描述信息 Accounts []*types.QOSAccount `json:"accounts"` }
create QSC
func (TxCreateQSC) CalcGas ¶
func (tx TxCreateQSC) CalcGas() btypes.BigInt
func (TxCreateQSC) GetGasPayer ¶
func (tx TxCreateQSC) GetGasPayer() btypes.Address
func (TxCreateQSC) GetSignData ¶
func (tx TxCreateQSC) GetSignData() (ret []byte)
func (TxCreateQSC) GetSigner ¶
func (tx TxCreateQSC) GetSigner() []btypes.Address
func (TxCreateQSC) ValidateData ¶
func (tx TxCreateQSC) ValidateData(ctx context.Context) error
type TxIssueQSC ¶
type TxIssueQSC struct { QSCName string `json:"qsc_name"` //币名 Amount btypes.BigInt `json:"amount"` //金额 Banker btypes.Address `json:"banker"` //banker地址 }
issue QSC
func (TxIssueQSC) CalcGas ¶
func (tx TxIssueQSC) CalcGas() btypes.BigInt
func (TxIssueQSC) GetGasPayer ¶
func (tx TxIssueQSC) GetGasPayer() btypes.Address
func (TxIssueQSC) GetSignData ¶
func (tx TxIssueQSC) GetSignData() (ret []byte)
func (TxIssueQSC) GetSigner ¶
func (tx TxIssueQSC) GetSigner() []btypes.Address
func (TxIssueQSC) ValidateData ¶
func (tx TxIssueQSC) ValidateData(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.