adapt

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: GPL-3.0 Imports: 10 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
	Other_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, error)

	// 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 getServiceIDList from dest chain
	GetServiceIDList() ([]string, error)

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

func NewAppchainAdapter

func NewAppchainAdapter(config *repo.Config, logger logrus.FieldLogger) (Adapt, error)

type AppchainAdapter

type AppchainAdapter struct {
	// contains filtered or unexported fields
}

func (*AppchainAdapter) GetServiceIDList

func (a *AppchainAdapter) GetServiceIDList() ([]string, error)

func (*AppchainAdapter) MonitorIBTP

func (a *AppchainAdapter) MonitorIBTP() chan *pb.IBTP

func (*AppchainAdapter) Name

func (a *AppchainAdapter) Name() (string, error)

func (*AppchainAdapter) QueryIBTP

func (a *AppchainAdapter) QueryIBTP(id string, isReq bool) (*pb.IBTP, error)

func (*AppchainAdapter) QueryInterchain

func (a *AppchainAdapter) QueryInterchain(serviceID string) (*pb.Interchain, error)

func (*AppchainAdapter) SendIBTP

func (a *AppchainAdapter) SendIBTP(ibtp *pb.IBTP) error

func (*AppchainAdapter) Start

func (a *AppchainAdapter) Start() error

func (*AppchainAdapter) Stop

func (a *AppchainAdapter) Stop() 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