executor

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelExecutor

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

ChannelExecutor represents the necessary data for executing interchain txs in appchain

func New

func New(client client.Client, pierID string, storage storage.Storage, cryptor txcrypto.Cryptor) (*ChannelExecutor, error)

New creates new instance of Executor. agent is for interacting with counterpart chain client is for interacting with appchain, meta is for recording interchain tx meta information and ds is for persisting some runtime messages

func (*ChannelExecutor) HandleIBTP

func (e *ChannelExecutor) HandleIBTP(ibtp *pb.IBTP) *pb.IBTP

applyIBTP handle ibtps of any type

func (*ChannelExecutor) QueryLatestMeta

func (e *ChannelExecutor) QueryLatestMeta() map[string]uint64

func (*ChannelExecutor) QueryReceipt

func (e *ChannelExecutor) QueryReceipt(from string, idx uint64, originalIBTP *pb.IBTP) (*pb.IBTP, error)

getReceipt only generates one receipt given source chain id and interchain tx index

func (*ChannelExecutor) Start

func (e *ChannelExecutor) Start() error

Start implements Executor

func (*ChannelExecutor) Stop

func (e *ChannelExecutor) Stop() error

Stop implements Executor

type Executor

type Executor interface {
	// Start starts the service of executor
	Start() error

	// Stop stops the service of executor
	Stop() error

	// HandleIBTP handles interchain ibtps from other appchains
	// and return the receipt ibtp for ack or callback
	HandleIBTP(ibtp *pb.IBTP) *pb.IBTP

	// QueryLatestMeta queries latest index map of ibtps executed on appchain
	QueryLatestMeta() map[string]uint64

	// QueryReceipt query receipt for original interchain ibtp
	QueryReceipt(from string, idx uint64, originalIBTP *pb.IBTP) (*pb.IBTP, error)
}

Directories

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

Jump to

Keyboard shortcuts

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