adapt

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success = iota
	SrcChain_Unavailable
	TargetChain_Unavailable
	SrcChainService_Unavailable
	TargetChainService_Unavailable
	ValidationRules_Unregister
	Proof_Invalid
	Index_Wrong
	InvalidIBTP
	Other_Error
	PierConnect_Error
)

error type

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapt

type Adapt interface {
	// Start starts adapt
	Start() error
	// Stop stops adapt
	Stop() error
	// Name get adapt name
	Name() string
	// ID   get adapt ID
	ID() string

	// MonitorIBTP listen on ibtp from dest chain
	MonitorIBTP() chan *pb.IBTP

	// QueryIBTP query ibtp by id and type, contain multi_sign
	QueryIBTP(id string, isReq bool) (*pb.IBTP, error)

	// SendIBTP check and send ibtp to dest chain
	SendIBTP(ibtp *pb.IBTP) error

	// GetServiceIDList relay/direct: AppChainAdapt, union:BxhAdapt
	GetServiceIDList() ([]string, error)

	// QueryInterchain  queryInterchain from dest chain
	QueryInterchain(serviceID string) (*pb.Interchain, error)

	// MonitorUpdatedMeta monitor validators change or block header change from AppChain on relay mode
	// 中继/直连模式监听appchain,bxh,union模式监听bxhAdapt
	MonitorUpdatedMeta() chan *[]byte

	// SendUpdatedMeta send validators change or block header change to bitXHub on relay mode
	// 中继模式发送给appchain,bxh,直连模式发送给DirectAdapt,appchain,union模式发送给unionAdapt
	SendUpdatedMeta(byte []byte) error
}

type SendIbtpError

type SendIbtpError struct {
	Err    string
	Status int
}

func (*SendIbtpError) Error

func (e *SendIbtpError) Error() string

func (*SendIbtpError) NeedRetry

func (e *SendIbtpError) NeedRetry() bool

Directories

Path Synopsis
Package mock_adapt is a generated GoMock package.
Package mock_adapt is a generated GoMock package.

Jump to

Keyboard shortcuts

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