base

package
v0.0.0-...-17003a6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigBase

type ConfigBase struct {
	// Path is the path of script file
	Path string
	// Ctx is the context of vm
	Ctx fcom.VMContext
}

ConfigBase define base config in vm.

type VMBase

type VMBase struct {
	ConfigBase
	Logger *logging.Logger
}

VMBase the base vm for support base config.

func NewVMBase

func NewVMBase(config ConfigBase) *VMBase

NewVMBase use given config create VMBase.

func (*VMBase) AfterRun

func (v *VMBase) AfterRun() error

AfterRun will call once after run.

func (*VMBase) BeforeDeploy

func (v *VMBase) BeforeDeploy() error

BeforeDeploy will call before deploy contract.

func (*VMBase) BeforeGet

func (v *VMBase) BeforeGet() error

BeforeGet will call before get context.

func (*VMBase) BeforeRun

func (v *VMBase) BeforeRun() error

BeforeRun will call once before run.

func (*VMBase) BeforeSet

func (v *VMBase) BeforeSet() error

BeforeSet will call before set context.

func (*VMBase) Close

func (v *VMBase) Close()

Close close vm.

func (*VMBase) DeployContract

func (v *VMBase) DeployContract() error

DeployContract deploy contract.

func (*VMBase) GetContext

func (v *VMBase) GetContext() ([]byte, error)

GetContext generate context for execute tx in vm.

func (*VMBase) LogStatus

func (v *VMBase) LogStatus() (int64, error)

LogStatus records blockheight and time

func (*VMBase) Run

func (v *VMBase) Run(ctx fcom.TxContext) (*fcom.Result, error)

Run create and send tx to client.

func (*VMBase) SetContext

func (v *VMBase) SetContext(ctx []byte) error

SetContext set context for execute tx in vm, the ctx is generated by GetContext.

func (*VMBase) Statistic

func (v *VMBase) Statistic(from, to int64) (*fcom.RemoteStatistic, error)

Statistic statistic remote execute info.

func (*VMBase) Type

func (v *VMBase) Type() string

Type return the vm type.

Jump to

Keyboard shortcuts

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