vm

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: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Caller           *types.Address
	Callee           *types.Address
	CurrentCaller    *types.Address
	Ledger           *ledger.Ledger
	TransactionIndex uint64
	TransactionData  *pb.TransactionData
	CurrentHeight    uint64
	Nonce            uint64
	Tx               pb.Transaction
	Logger           logrus.FieldLogger
}

Context represents the context of wasm

func NewContext

func NewContext(tx pb.Transaction, txIndex uint64, data *pb.TransactionData, currentHeight uint64, ledger *ledger.Ledger, logger logrus.FieldLogger) *Context

NewContext creates a context of wasm instance

type VM

type VM interface {
	// Run should execute the given contract with the given input
	// and return the contract execution return bytes or an error if it
	// failed.
	Run(input []byte, gasLimit uint64) ([]byte, uint64, error)
}

VM is the basic interface for an implementation of the VM.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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