Documentation ¶
Index ¶
- Constants
- func NewWASMTimeRuntime(ctx context.Context, logger types.Logger, code []byte, ...) (out types.AspectRuntime, err error)
- func Wrap(api *types.HostAPIRegistry, module types.Module, ns types.NameSpace, ...) (interface{}, error)
- type Context
- func (c *Context) AddEVMGas(gas int64) error
- func (c *Context) AllocMemory(size int32) (int32, error)
- func (c *Context) ConsumeWASMGas(gas int64) error
- func (c *Context) Logger() types.Logger
- func (c *Context) ReadMemory(ptr int32, size int32) ([]byte, error)
- func (c *Context) RemainingEVMGas() (int64, error)
- func (c *Context) RemainingWASMGas() (int64, error)
- func (c *Context) Reset()
- func (c *Context) SetWASMGas(gas int64) error
- func (c *Context) WriteMemory(ptr int32, data []byte) error
Constants ¶
View Source
const (
MaxMemorySize = 32 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func NewWASMTimeRuntime ¶
func NewWASMTimeRuntime(ctx context.Context, logger types.Logger, code []byte, apis *types.HostAPIRegistry) (out types.AspectRuntime, err error)
func Wrap ¶
func Wrap(api *types.HostAPIRegistry, module types.Module, ns types.NameSpace, method types.MethodName, hostFunc *types.HostFuncWithGasRule) (interface{}, error)
Types ¶
type Context ¶
type Context struct { context.Context // memory *Memory Instance *wasmtime.Instance Store *wasmtime.Store // contains filtered or unexported fields }
func (*Context) ConsumeWASMGas ¶
func (*Context) RemainingEVMGas ¶
func (*Context) RemainingWASMGas ¶
func (*Context) SetWASMGas ¶
Click to show internal directories.
Click to hide internal directories.