contract

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constructor

type Constructor func(ref reference.Global, args []byte, helper ProxyHelper) (state []byte, result []byte, err error)

Constructor is a typedef of typical contract constructor

type Constructors

type Constructors map[string]Constructor

Constructors maps name to contract constructor

type Method

type Method struct {
	Func      MethodFunc
	Isolation MethodIsolation
}

Method is a struct for Method and it's properties

type MethodFunc

type MethodFunc func(oldState []byte, args []byte, helper ProxyHelper) (newState []byte, result []byte, err error)

MethodFunc is a typedef for wrapper contract header

type MethodIsolation

type MethodIsolation struct {
	Interference isolation.InterferenceFlag
	State        isolation.StateFlag
}

func ConstructorIsolation

func ConstructorIsolation() MethodIsolation

func (MethodIsolation) IsZero

func (i MethodIsolation) IsZero() bool

type Methods

type Methods map[string]Method

Methods maps name to contract method

type ProxyHelper

type ProxyHelper interface {
	common.SystemError
	common.Serializer
	CallMethod(
		ref reference.Global,
		tolerance isolation.InterferenceFlag, isolation isolation.StateFlag, saga bool,
		method string, args []byte, proxyClass reference.Global,
	) (result []byte, err error)
	CallConstructor(
		parentRef, classRef reference.Global, constructorName string, argsSerialized []byte,
	) (result []byte, err error)
	DeactivateObject(object reference.Global) error
	MakeErrorSerializable(error) error
}

ProxyHelper interface with methods that are needed by contract proxies

type Wrapper

type Wrapper struct {
	GetCode  MethodFunc
	GetClass MethodFunc

	Methods      Methods
	Constructors Constructors
}

Wrapper stores all needed about contract wrapper (it's methods/constructors)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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