builtin

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package builtin is implementation of builtin contracts engine

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyHelper

type ProxyHelper struct {
	common.Serializer
	common.SystemError
	// contains filtered or unexported fields
}

func NewProxyHelper

func NewProxyHelper(runner common.RunnerRPCStub) *ProxyHelper

func (*ProxyHelper) CallConstructor

func (h *ProxyHelper) CallConstructor(
	parentRef, classRef reference.Global,
	constructorName string, argsSerialized []byte,
) (
	[]byte, error,
)

func (*ProxyHelper) CallMethod

func (h *ProxyHelper) CallMethod(
	ref reference.Global, tolerance isolation.InterferenceFlag, isolation isolation.StateFlag,
	_ bool, method string, args []byte,
	proxyClass reference.Global,
) (
	[]byte, error,
)

func (*ProxyHelper) DeactivateObject

func (h *ProxyHelper) DeactivateObject(object reference.Global) error

func (*ProxyHelper) MakeErrorSerializable

func (h *ProxyHelper) MakeErrorSerializable(err error) error

type Runner

type Runner struct {
	Helper             contract.ProxyHelper
	DescriptorRegistry map[reference.Global]interface{}
	CodeRegistry       map[string]contract.Wrapper
	CodeRefRegistry    map[reference.Global]string
	ClassRefRegistry   map[reference.Global]string
}

Runner is a contract runner engine

func New

func New(stub common.RunnerRPCStub) *Runner

New is an constructor

func (*Runner) CallConstructor

func (r *Runner) CallConstructor(
	_ context.Context,
	callCtx *call.LogicContext,
	codeRef reference.Global,
	name string,
	args []byte,
) ([]byte, []byte, error)

func (*Runner) CallMethod

func (r *Runner) CallMethod(
	_ context.Context,
	callCtx *call.LogicContext,
	codeRef reference.Global,
	data []byte,
	method string,
	args []byte,
) ([]byte, []byte, error)

func (*Runner) ClassifyMethod

func (r *Runner) ClassifyMethod(_ context.Context,
	codeRef reference.Global,
	method string) (contract.MethodIsolation, error)

func (*Runner) GetDescriptor

func (r *Runner) GetDescriptor(ref reference.Global) (interface{}, error)

Jump to

Keyboard shortcuts

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