vm

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VmFactory

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

func NewVM

func NewVM() VmFactory

func NewVMwithInstance added in v0.1.2

func NewVMwithInstance(vm VmInterface) *VmFactory

func (*VmFactory) AddVm

func (v *VmFactory) AddVm(context types.Context, statedb types.StateDB, cfg types.VmConfig)

func (*VmFactory) GetEvm

func (v *VmFactory) GetEvm() VmInterface

func (*VmFactory) GetRealVm

func (v *VmFactory) GetRealVm(code []byte, toPtr *common.Address) VmInterface

func (*VmFactory) GetWasm

func (v *VmFactory) GetWasm() VmInterface

type VmInterface

type VmInterface interface {
	Reset(types.Message)
	Cancel()
	UTXOCall(caller types.ContractRef, addr, token common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, leftOverGas uint64, byteCodeGas uint64, err error)
	Call(caller types.ContractRef, addr, token common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, leftOverGas uint64, byteCodeGas uint64, err error)
	CallCode(caller types.ContractRef, addr common.Address, input []byte, gas uint64, value *big.Int) (ret []byte, leftOverGas uint64, byteCodeGas uint64, err error)
	DelegateCall(caller types.ContractRef, addr common.Address, input []byte, gas uint64) (ret []byte, leftOverGas uint64, byteCodeGas uint64, err error)
	StaticCall(caller types.ContractRef, addr common.Address, input []byte, gas uint64) (ret []byte, leftOverGas uint64, byteCodeGas uint64, err error)
	Create(caller types.ContractRef, code []byte, gas uint64, value *big.Int) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error)
	Upgrade(caller types.ContractRef, addr common.Address, code []byte) error
	// Interpreter() types.Interpreter
	SetToken(addr common.Address)
	GetCoinbase() common.Address
	GetBlockNumber() *big.Int
	GetTime() *big.Int
	GasRate() uint64
	GetStateDB() types.StateDB
	GetOTxs() []types.BalanceRecord
	AddOtx(br types.BalanceRecord)
	RefundFee() uint64
	RefundAllFee() uint64
}

Directories

Path Synopsis
Package vm implements the Ethereum Virtual Machine.
Package vm implements the Ethereum Virtual Machine.
Package runtime provides a basic execution model for executing EVM code.
Package runtime provides a basic execution model for executing EVM code.
wasm-run command

Jump to

Keyboard shortcuts

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