types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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

	CodeInvalidInput       btypes.CodeType = 401 // 信息有误
	CodeInvalidQCPCA       btypes.CodeType = 402 // 无效证书
	CodeWrongQCPCA         btypes.CodeType = 403 // 证书有误
	CodeCreatorNotExists   btypes.CodeType = 404 // 创建账户不存在
	CodeQCPExists          btypes.CodeType = 405 // QCP已存在
	CodeEmptyCreator       btypes.CodeType = 406 // 创建账户为空
	CodeRootCANotConfigure btypes.CodeType = 407 // 没有配置root ca
)

QCP errors reserve 400 ~ 499.

Variables

View Source
var (
	// 事件类型
	EventTypeInitQcp = "init-qcp" // 初始化联盟链

	// 事件参数
	AttributeKeyModule  = qcp.EventModule // 模块名称
	AttributeKeyQcp     = "chain-id"      // 联盟链chain-id
	AttributeKeyCreator = "creator"       // 创建账户地址
)

Functions

func ErrCreatorNotExists added in v0.0.6

func ErrCreatorNotExists() btypes.Error

func ErrEmptyCreator added in v0.0.8

func ErrEmptyCreator() btypes.Error

func ErrInvalidInput added in v0.0.6

func ErrInvalidInput(msg string) btypes.Error

func ErrInvalidQCPCA added in v0.0.6

func ErrInvalidQCPCA() btypes.Error

func ErrQCPExists added in v0.0.6

func ErrQCPExists() btypes.Error

func ErrRootCANotConfigure added in v0.0.8

func ErrRootCANotConfigure() btypes.Error

func ErrWrongQCPCA added in v0.0.6

func ErrWrongQCPCA() btypes.Error

func ValidateGenesis added in v0.0.6

func ValidateGenesis(gs GenesisState) error

Types

type GenesisState added in v0.0.6

type GenesisState struct {
	RootPubKey crypto.PubKey `json:"ca_root_pub_key"` // kepler根证书公钥
	QCPs       []QCPInfo     `json:"qcps""`           // 初始联盟链信息
}

创世状态

func DefaultGenesisState added in v0.0.6

func DefaultGenesisState() GenesisState

func NewGenesisState added in v0.0.6

func NewGenesisState(pubKey crypto.PubKey, qcps []QCPInfo) GenesisState

type QCPInfo

type QCPInfo struct {
	ChainId     string        `json:"chain_id"`     // 联盟链标识
	SequenceOut int64         `json:"sequence_out"` // 结果输出序号
	SequenceIn  int64         `json:"sequence_in"`  // 交易接收序号
	PubKey      crypto.PubKey `json:"pub_key"`      // 公钥
	OutTxs      []txs.TxQcp   `json:"txs"`          // 跨链交易结果集
}

联盟链信息

func NewQCPInfo

func NewQCPInfo(chainId string, sequenceOut int64, sequenceIn int64, pubKey crypto.PubKey, txs []txs.TxQcp) *QCPInfo

Jump to

Keyboard shortcuts

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