executor

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GasNormalTx = 21000
	GasFailedTx = 21000
	GasBVMTx    = 21000 * 10
)

Variables

This section is empty.

Functions

func NewSerialExecutor added in v1.0.1

Types

type BlockExecutor

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

BlockExecutor executes block from order

func New

func New(chainLedger *ledger.Ledger, logger logrus.FieldLogger, client *appchain.Client, config *repo.Config, gasPrice *big.Int) (*BlockExecutor, error)

New creates executor instance

func (*BlockExecutor) ApplyReadonlyTransactions added in v1.0.1

func (exec *BlockExecutor) ApplyReadonlyTransactions(txs []pb.Transaction) []*pb.Receipt

func (*BlockExecutor) ExecuteBlock

func (exec *BlockExecutor) ExecuteBlock(block *pb.CommitEvent)

ExecuteBlock executes block from order

func (*BlockExecutor) GetBoltContracts added in v1.10.0

func (exec *BlockExecutor) GetBoltContracts() map[string]agency.Contract

func (*BlockExecutor) Start

func (exec *BlockExecutor) Start() error

Start starts executor

func (*BlockExecutor) Stop

func (exec *BlockExecutor) Stop() error

Stop stops executor

func (*BlockExecutor) SubscribeBlockEvent

func (exec *BlockExecutor) SubscribeBlockEvent(ch chan<- events.ExecutedEvent) event.Subscription

SubscribeBlockEvent registers a subscription of ExecutedEvent.

func (*BlockExecutor) SubscribeLogsEvent added in v1.8.0

func (exec *BlockExecutor) SubscribeLogsEvent(ch chan<- []*pb.EvmLog) event.Subscription

func (*BlockExecutor) SubscribeNodeEvent added in v1.10.0

func (exec *BlockExecutor) SubscribeNodeEvent(ch chan<- events.NodeEvent) event.Subscription

type BlockWrapper added in v1.8.0

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

type Executor

type Executor interface {
	// Start
	Start() error

	// Stop
	Stop() error

	// ExecutorBlock
	ExecuteBlock(commitEvent *pb.CommitEvent)

	// ApplyReadonlyTransactions execute readonly tx
	ApplyReadonlyTransactions(txs []pb.Transaction) []*pb.Receipt

	// SubscribeBlockEvent
	SubscribeBlockEvent(chan<- events.ExecutedEvent) event.Subscription

	// SubscribeLogEvent
	SubscribeLogsEvent(chan<- []*pb.EvmLog) event.Subscription

	// SubscribeNodeEvent
	SubscribeNodeEvent(chan<- events.NodeEvent) event.Subscription

	GetBoltContracts() map[string]agency.Contract
}

type SerialExecutor added in v1.0.1

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

func (*SerialExecutor) AddInterchainCounter added in v1.0.1

func (se *SerialExecutor) AddInterchainCounter(to string, index *pb.VerifiedIndex)

func (*SerialExecutor) AddNormalTx added in v1.0.1

func (se *SerialExecutor) AddNormalTx(hash *types.Hash)

func (*SerialExecutor) ApplyTransactions added in v1.0.1

func (se *SerialExecutor) ApplyTransactions(txs []pb.Transaction, invalidTxs map[int]agency.InvalidReason) []*pb.Receipt

func (*SerialExecutor) GetBoltContracts added in v1.0.1

func (se *SerialExecutor) GetBoltContracts() map[string]agency.Contract

func (*SerialExecutor) GetDescription added in v1.8.0

func (se *SerialExecutor) GetDescription() string

func (*SerialExecutor) GetInterchainCounter added in v1.0.1

func (se *SerialExecutor) GetInterchainCounter() map[string][]*pb.VerifiedIndex

func (*SerialExecutor) GetNormalTxs added in v1.0.1

func (se *SerialExecutor) GetNormalTxs() []*types.Hash

Directories

Path Synopsis
oracle

Jump to

Keyboard shortcuts

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