wasm

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyImports

func EmptyImports() (*wasmer.Imports, error)

Types

type Contract

type Contract struct {
	// contract byte
	Code []byte

	// contract hash
	Hash types.Hash
}

Contract represents the smart contract structure used in the wasm vm

type Wasm

type Wasm struct {
	// wasm instance
	Instance wasmer.Instance
	// contains filtered or unexported fields
}

Wasm represents the wasm vm in BitXHub

func New

func New(contractByte []byte, imports *wasmer.Imports) (*Wasm, error)

New creates a wasm vm instance

func (*Wasm) Execute

func (w *Wasm) Execute(input []byte) ([]byte, error)

func (*Wasm) SetBytes

func (w *Wasm) SetBytes(b []byte) (int32, error)

SetBytes set bytes type arg for wasm

func (*Wasm) SetString

func (w *Wasm) SetString(str string) (int32, error)

SetString set the string type arg for wasm

Jump to

Keyboard shortcuts

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