qsc

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

Documentation

Index

Constants

View Source
const (
	QSCMapperName = "qsc"
	QSCKey        = "qsc/[%s]"
)

Variables

View Source
var (
	CreatorQOSLimit = btypes.NewInt(0) //TODO
)

Functions

func BuildQSCKey

func BuildQSCKey(qscName string) []byte

func RegisterCodec

func RegisterCodec(cdc *amino.Codec)

func VerityCrt

func VerityCrt(pubKey crypto.PubKey, crt *Certificate) bool

Types

type Certificate

type Certificate struct {
	CSR       CertificateSigningRequest `json:"csr"`
	CA        Issuer                    `json:"ca"`
	Signature []byte                    `json:"signature"`
}

type CertificateSigningRequest

type CertificateSigningRequest struct {
	Subj      Subject               `json:"subj"`
	IsCa      bool                  `json:"is_ca"`
	IsBanker  bool                  `json:"is_banker"`
	NotBefore time.Time             `json:"not_before"`
	NotAfter  time.Time             `json:"not_after"`
	PublicKey ed25519.PubKeyEd25519 `json:"public_key"`
}

type Issuer

type Issuer struct {
	Subj      Subject               `json:"subj"`
	PublicKey ed25519.PubKeyEd25519 `json:"public_key"`
}

type QSCInfo

type QSCInfo = TxCreateQSC

type QSCMapper

type QSCMapper struct {
	*mapper.BaseMapper
}

func NewQSCMapper

func NewQSCMapper() *QSCMapper

func (*QSCMapper) Copy

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

func (*QSCMapper) Exists

func (mapper *QSCMapper) Exists(qscName string) bool

func (*QSCMapper) GetQsc

func (mapper *QSCMapper) GetQsc(qscName string) (qscinfo *QSCInfo)

func (*QSCMapper) SaveQsc

func (mapper *QSCMapper) SaveQsc(qscInfo *QSCInfo)

type Subject

type Subject struct {
	CN string `json:"cn"`
}

types and funcs for CA copy from QOSGroup/kepler TODO remove -----------------------------------------------------------------

type TxCreateQSC

type TxCreateQSC struct {
	ChainID     string               `json:"chain_id"`    //chain-id
	Creator     btypes.Address       `json:"creator"`     //QSC创建账户
	Extrate     string               `json:"extrate"`     //qcs:qos汇率(amino不支持binary形式的浮点数序列化,精度同qos erc20 [.0000])
	QSCCA       *Certificate         `json:"ca_qsc"`      //CA信息
	BankerCA    *Certificate         `json:"ca_banker"`   //CA信息
	Description string               `json:"description"` //描述信息
	Accounts    []account.QOSAccount `json:"accounts"`    //初始化时接受qsc的账户
}

create QSC

func (TxCreateQSC) CalcGas

func (tx TxCreateQSC) CalcGas() btypes.BigInt

func (TxCreateQSC) Exec

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

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) Exec

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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