Documentation
¶
Index ¶
- Constants
- func EmptyImports() (*wasmer.Imports, error)
- type Contract
- type Wasm
- func (w *Wasm) Execute(input []byte) ([]byte, error)
- func (w *Wasm) FreeBytes(inputPointer interface{}, b []byte) error
- func (w *Wasm) FreeString(inputPointer interface{}, str string) error
- func (w *Wasm) SetBytes(b []byte) (int32, error)
- func (w *Wasm) SetContext(key string, value interface{})
- func (w *Wasm) SetString(str string) (int32, error)
Constants ¶
View Source
const ( CONTEXT_ARGMAP = "argmap" CONTEXT_INTERFACE = "interface" )
Variables ¶
This section is empty.
Functions ¶
func EmptyImports ¶
Types ¶
type Wasm ¶
type Wasm struct { // wasm instance Instance wasmer.Instance sync.RWMutex // contains filtered or unexported fields }
Wasm represents the wasm vm in BitXHub
func New ¶
func New(contractByte []byte, imports *wasmer.Imports, instances map[string]wasmer.Instance) (*Wasm, error)
New creates a wasm vm instance
func (*Wasm) FreeString ¶ added in v1.0.2
FreeString free the string type arg for wasm
func (*Wasm) SetContext ¶ added in v1.0.2
Click to show internal directories.
Click to hide internal directories.