Documentation ¶
Index ¶
- type Cache
- func (cps *Cache) ExistsProcessor(h hashing.HashValue) bool
- func (cps *Cache) GetOrCreateProcessor(rec *root.ContractRecord, getBinary GetBinaryFunc) (isc.VMProcessor, error)
- func (cps *Cache) GetOrCreateProcessorByProgramHash(progHash hashing.HashValue, getBinary GetBinaryFunc) (isc.VMProcessor, error)
- func (cps *Cache) NewProcessor(programHash hashing.HashValue, programCode []byte, vmtype string) error
- func (cps *Cache) RemoveProcessor(h hashing.HashValue)
- type Config
- func (p *Config) GetCoreProcessor(programHash hashing.HashValue) (isc.VMProcessor, bool)
- func (p *Config) GetNativeProcessor(programHash hashing.HashValue) (isc.VMProcessor, bool)
- func (p *Config) GetNativeProcessorType(programHash hashing.HashValue) (string, bool)
- func (p *Config) NewProcessorFromBinary(vmtype string, binaryCode []byte) (isc.VMProcessor, error)
- func (p *Config) RegisterNativeContract(c *coreutil.ContractProcessor)
- func (p *Config) RegisterVMType(vmtype string, constructor VMConstructor) error
- func (p *Config) WithCoreContracts(coreContracts map[hashing.HashValue]isc.VMProcessor) *Config
- func (p *Config) WithNativeContracts(nativeContracts ...*coreutil.ContractProcessor) *Config
- type GetBinaryFunc
- type VMConstructor
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 (*Cache) ExistsProcessor ¶ added in v0.2.0
func (*Cache) GetOrCreateProcessor ¶ added in v0.2.0
func (cps *Cache) GetOrCreateProcessor(rec *root.ContractRecord, getBinary GetBinaryFunc) (isc.VMProcessor, error)
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
RemoveProcessor deletes processor from cache
type Config ¶ added in v0.2.0
type Config struct {
// contains filtered or unexported fields
}
func (*Config) GetCoreProcessor ¶ added in v0.3.0
func (*Config) GetNativeProcessor ¶ added in v0.2.0
func (*Config) GetNativeProcessorType ¶ added in v0.2.0
GetNativeProcessorType returns the type of the native processor
func (*Config) NewProcessorFromBinary ¶ added in v0.2.0
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 (*Config) WithNativeContracts ¶ added in v0.3.0
func (p *Config) WithNativeContracts(nativeContracts ...*coreutil.ContractProcessor) *Config
type GetBinaryFunc ¶ added in v0.3.0
type VMConstructor ¶
type VMConstructor func(binaryCode []byte) (isc.VMProcessor, error)