engine

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: MIT, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContractMethodName = "invoke"
	ContractInitMethod = "init"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecuteEngine

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

func NewExecuteEngine

func NewExecuteEngine(caller types.Address, contract *types.SmartContractBlock, ledger *ledger.Ledger) *ExecuteEngine

NewExecuteEngine new vm execute engine

func (*ExecuteEngine) Call

func (e *ExecuteEngine) Call(data []byte) (result []byte, err error)

Call invoke to run the contract code by block.data

func (*ExecuteEngine) GenerateBlock

func (e *ExecuteEngine) GenerateBlock(block *types.StateBlock, signFn SignFunc) (result *GenResult, err error)

func (*ExecuteEngine) InitCall

func (e *ExecuteEngine) InitCall(args []byte) (result []byte, err error)

InitCall init method on deployment

func (*ExecuteEngine) Run

func (e *ExecuteEngine) Run(block, sendBlock *types.StateBlock) (blockList []*types.StateBlock, isRetry bool, err error)

type GenResult

type GenResult struct {
	Blocks  []*types.StateBlock
	IsRetry bool
	Error   error
}

type SignFunc

type SignFunc func(addr types.Address, data []byte) (types.Signature, error)

Jump to

Keyboard shortcuts

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