contracts

package
v1.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const PREFIX = "tx-"

Variables

This section is empty.

Functions

func AssetExchangeKey added in v1.0.1

func AssetExchangeKey(id string) string

Types

type AppchainManager

type AppchainManager struct {
	boltvm.Stub
	appchainMgr.AppchainManager
}

func (*AppchainManager) Appchain

func (am *AppchainManager) Appchain() *boltvm.Response

Appchain returns appchain info

func (*AppchainManager) Appchains

func (am *AppchainManager) Appchains() *boltvm.Response

Appchains returns all appchains

func (*AppchainManager) Audit

func (am *AppchainManager) Audit(proposer string, isApproved int32, desc string) *boltvm.Response

Audit bitxhub manager audit appchain register info

func (*AppchainManager) CountAppchains

func (am *AppchainManager) CountAppchains() *boltvm.Response

CountAppchains counts all appchains including approved, rejected or registered

func (*AppchainManager) CountApprovedAppchains

func (am *AppchainManager) CountApprovedAppchains() *boltvm.Response

CountApprovedAppchains counts all approved appchains

func (*AppchainManager) DeleteAppchain

func (am *AppchainManager) DeleteAppchain(cid string) *boltvm.Response

func (*AppchainManager) FetchAuditRecords

func (am *AppchainManager) FetchAuditRecords(id string) *boltvm.Response

FetchAuditRecords fetches audit records by appchain id

func (*AppchainManager) GetAppchain

func (am *AppchainManager) GetAppchain(id string) *boltvm.Response

GetAppchain returns appchain info by appchain id

func (*AppchainManager) GetPubKeyByChainID

func (am *AppchainManager) GetPubKeyByChainID(id string) *boltvm.Response

GetPubKeyByChainID can get aim chain's public key using aim chain ID

func (*AppchainManager) IsAdmin

func (am *AppchainManager) IsAdmin() *boltvm.Response

func (*AppchainManager) Register

func (am *AppchainManager) Register(validators string, consensusType int32, chainType, name, desc, version, pubkey string) *boltvm.Response

Register appchain managers registers appchain info caller is the appchain manager address return appchain id and error

func (*AppchainManager) UpdateAppchain

func (am *AppchainManager) UpdateAppchain(validators string, consensusType int32, chainType, name, desc, version, pubkey string) *boltvm.Response

UpdateAppchain updates approved appchain

type AssetExchange added in v1.0.1

type AssetExchange struct {
	boltvm.Stub
}

func (*AssetExchange) GetStatus added in v1.0.1

func (t *AssetExchange) GetStatus(id string) *boltvm.Response

func (*AssetExchange) Init added in v1.0.1

func (t *AssetExchange) Init(from, to string, info []byte) *boltvm.Response

func (*AssetExchange) Redeem added in v1.0.1

func (t *AssetExchange) Redeem(from, to string, info []byte) *boltvm.Response

func (*AssetExchange) Refund added in v1.0.1

func (t *AssetExchange) Refund(from, to string, info []byte) *boltvm.Response

type AssetExchangeRecord added in v1.0.1

type AssetExchangeRecord struct {
	Chain0 string
	Chain1 string
	Status AssetExchangeStatus
	Info   pb.AssetExchangeInfo
}

type AssetExchangeStatus added in v1.0.1

type AssetExchangeStatus uint64
const (
	ASSET_PREFIX                            = "asset-"
	AssetExchangeInit   AssetExchangeStatus = 0
	AssetExchangeRedeem AssetExchangeStatus = 1
	AssetExchangeRefund AssetExchangeStatus = 2
)

type AssetExchangeType added in v1.0.1

type AssetExchangeType uint64

type Interchain

type Interchain struct {
	ID                   string            `json:"id"`
	InterchainCounter    map[string]uint64 `json:"interchain_counter,omitempty"`
	ReceiptCounter       map[string]uint64 `json:"receipt_counter,omitempty"`
	SourceReceiptCounter map[string]uint64 `json:"source_receipt_counter,omitempty"`
}

func (*Interchain) UnmarshalJSON

func (i *Interchain) UnmarshalJSON(data []byte) error

type InterchainManager

type InterchainManager struct {
	boltvm.Stub
}

func (*InterchainManager) DeleteInterchain

func (x *InterchainManager) DeleteInterchain(id string) *boltvm.Response

func (*InterchainManager) GetIBTPByID

func (x *InterchainManager) GetIBTPByID(id string) *boltvm.Response

func (*InterchainManager) HandleIBTP

func (x *InterchainManager) HandleIBTP(data []byte) *boltvm.Response

func (*InterchainManager) HandleIBTPs added in v1.0.1

func (x *InterchainManager) HandleIBTPs(data []byte) *boltvm.Response

func (*InterchainManager) Interchain

func (x *InterchainManager) Interchain() *boltvm.Response

Interchain returns information of the interchain count, Receipt count and SourceReceipt count

func (*InterchainManager) ProcessIBTP added in v1.0.1

func (x *InterchainManager) ProcessIBTP(ibtp *pb.IBTP, interchain *Interchain)

func (*InterchainManager) Register

func (x *InterchainManager) Register() *boltvm.Response

type Role

type Role struct {
	boltvm.Stub
}

func (*Role) GetAdminRoles

func (r *Role) GetAdminRoles() *boltvm.Response

func (*Role) GetRole

func (r *Role) GetRole() *boltvm.Response

func (*Role) IsAdmin

func (r *Role) IsAdmin(address string) *boltvm.Response

func (*Role) SetAdminRoles

func (r *Role) SetAdminRoles(addrs string) *boltvm.Response

type RuleManager

type RuleManager struct {
	boltvm.Stub
}

RuleManager is the contract manage validation rules

func (*RuleManager) Audit

func (r *RuleManager) Audit(id string, isApproved int32, desc string) *boltvm.Response

func (*RuleManager) GetRuleAddress

func (r *RuleManager) GetRuleAddress(id, chainType string) *boltvm.Response

func (*RuleManager) RegisterRule

func (r *RuleManager) RegisterRule(id string, address string) *boltvm.Response

SetRule can map the validation rule address with the chain id

type Store

type Store struct {
	boltvm.Stub
}

func (*Store) Get

func (s *Store) Get(key string) *boltvm.Response

func (*Store) Set

func (s *Store) Set(key string, value string) *boltvm.Response

type TransactionInfo added in v1.0.1

type TransactionInfo struct {
	GlobalState pb.TransactionStatus
	ChildTxInfo map[string]pb.TransactionStatus
}

type TransactionManager added in v1.0.1

type TransactionManager struct {
	boltvm.Stub
}

func (*TransactionManager) Begin added in v1.0.1

func (t *TransactionManager) Begin(txId string) *boltvm.Response

func (*TransactionManager) BeginMultiTXs added in v1.0.1

func (t *TransactionManager) BeginMultiTXs(globalId string, childTxIds ...string) *boltvm.Response

func (*TransactionManager) GetStatus added in v1.0.1

func (t *TransactionManager) GetStatus(txId string) *boltvm.Response

func (*TransactionManager) Report added in v1.0.1

func (t *TransactionManager) Report(txId string, result int32) *boltvm.Response

Jump to

Keyboard shortcuts

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