Documentation ¶
Index ¶
- Constants
- func NewStore() *wasmtime.Store
- type Contract
- type Wasm
- func (w *Wasm) Execute(input []byte, wasmGasLimit uint64) (ret []byte, gasUsed uint64, err error)
- func (w *Wasm) FreeBytes(inputPointer interface{}, b []byte) error
- func (w *Wasm) FreeString(inputPointer interface{}, str string) error
- func (w *Wasm) GetContext(key string) interface{}
- 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" ERROR = "error" ASSEMBLYSCRIPT_ENTRY = "_start" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Contract ¶
type Contract struct { // contract byte Code []byte `json:"code"` // contract hash Hash *types.Hash `json:"hash"` }
Contract represents the smart contract structure used in the wasm vm
type Wasm ¶
type Wasm struct { // wasm instance Instance *wasmtime.Instance Store *wasmtime.Store sync.RWMutex // contains filtered or unexported fields }
Wasm represents the wasm vm in BitXHub
func NewWithStore ¶
func (*Wasm) FreeString ¶
FreeString free the string type arg for wasm
func (*Wasm) GetContext ¶
func (*Wasm) SetContext ¶
Click to show internal directories.
Click to hide internal directories.