metering

package
v0.0.0-...-c56c372 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrImportMeterFunc = errors.New("importing metering function is not allowed")
)

Functions

func MeterWASM

func MeterWASM(wasm []byte, opts *Options) ([]byte, uint64, error)

MeterWASM injects metering into WebAssembly binary code. This func is the real exported function used by outer callers.

Types

type Metering

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

type Options

type Options struct {
	CostTable toolkit.JSON // path of cost table file.
	ModuleStr string       // the import string for metering function.
	FieldStr  string       // the field string for the metering function.
	MeterType string       // the register type that is used to meter. Can be `i64`, `i32`, `f64`, `f32`.
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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