processors

package
v1.0.4-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache added in v0.2.0

type Cache struct {
	Config *Config
	// contains filtered or unexported fields
}

Cache stores all initialized VMProcessor instances used by a single chain

func MustNew

func MustNew(config *Config) *Cache

func (*Cache) ExistsProcessor added in v0.2.0

func (cps *Cache) ExistsProcessor(h hashing.HashValue) bool

func (*Cache) GetOrCreateProcessorByProgramHash added in v0.2.0

func (cps *Cache) GetOrCreateProcessorByProgramHash(progHash hashing.HashValue, getBinary GetBinaryFunc) (isc.VMProcessor, error)

func (*Cache) NewProcessor added in v0.2.0

func (cps *Cache) NewProcessor(programHash hashing.HashValue, programCode []byte, vmtype string) error

NewProcessor deploys new processor in the cache

func (*Cache) RemoveProcessor added in v0.2.0

func (cps *Cache) RemoveProcessor(h hashing.HashValue)

RemoveProcessor deletes processor from cache

type Config added in v0.2.0

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig added in v0.2.0

func NewConfig() *Config

func (*Config) GetCoreProcessor added in v0.3.0

func (p *Config) GetCoreProcessor(programHash hashing.HashValue) (isc.VMProcessor, bool)

func (*Config) GetNativeProcessor added in v0.2.0

func (p *Config) GetNativeProcessor(programHash hashing.HashValue) (isc.VMProcessor, bool)

func (*Config) GetNativeProcessorType added in v0.2.0

func (p *Config) GetNativeProcessorType(programHash hashing.HashValue) (string, bool)

GetNativeProcessorType returns the type of the native processor

func (*Config) NewProcessorFromBinary added in v0.2.0

func (p *Config) NewProcessorFromBinary(vmtype string, binaryCode []byte) (isc.VMProcessor, error)

NewProcessorFromBinary creates an instance of the processor by its VM type and the binary code

func (*Config) RegisterNativeContract added in v0.2.0

func (p *Config) RegisterNativeContract(c *coreutil.ContractProcessor)

RegisterNativeContract registers a native contract so that it may be deployed

func (*Config) RegisterVMType added in v0.2.0

func (p *Config) RegisterVMType(vmtype string, constructor VMConstructor) error

RegisterVMType registers new VM type by providing a constructor function to construct an instance of the processor. The constructor is a closure which also may encompass configuration params for the VM The function is normally called from the init code

func (*Config) WithCoreContracts added in v0.3.0

func (p *Config) WithCoreContracts(coreContracts map[hashing.HashValue]isc.VMProcessor) *Config

func (*Config) WithNativeContracts added in v0.3.0

func (p *Config) WithNativeContracts(nativeContracts ...*coreutil.ContractProcessor) *Config

type GetBinaryFunc added in v0.3.0

type GetBinaryFunc func(hashing.HashValue) (string, []byte, error)

type VMConstructor

type VMConstructor func(binaryCode []byte) (isc.VMProcessor, error)

Jump to

Keyboard shortcuts

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