logicrunner

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package logicrunner - infrastructure for executing smartcontracts

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments []byte

Arguments is a dedicated type for arguments, that represented as bynary cbored blob

type ArtifactManager added in v0.0.3

type ArtifactManager interface {
	Get(ref string) (data []byte, codeRef Reference, err error)
}

ArtifactManager interface

type Executor added in v0.0.3

type Executor interface {
	Exec(codeRef Reference, data []byte, method string, args Arguments) (newObjectState []byte, methodResults Arguments, err error)
}

Executor is an interface for implementers of one particular machine type

type LogicRunner

type LogicRunner struct {
	Executors       [MachineTypesTotalCount]Executor
	ArtifactManager ArtifactManager
}

LogicRunner is a general interface of contract executor

func NewLogicRunner added in v0.0.3

func NewLogicRunner(am ArtifactManager) (*LogicRunner, error)

NewLogicRunner is constructor for `LogicRunner`

func (*LogicRunner) Execute added in v0.0.3

func (r *LogicRunner) Execute(ref string, method string, args Arguments) ([]byte, []byte, error)

Execute runs a method on an object, ATM just thin proxy to `GoPlugin.Exec`

func (*LogicRunner) GetExecutor added in v0.0.3

func (r *LogicRunner) GetExecutor(t MachineType) (Executor, error)

GetExecutor returns an executor for the `MachineType` if it was registered (`RegisterExecutor`), returns error otherwise

func (*LogicRunner) RegisterExecutor added in v0.0.3

func (r *LogicRunner) RegisterExecutor(t MachineType, e Executor) error

RegisterExecutor registers an executor for particular `MachineType`

type MachineType

type MachineType int

MachineType is a type of virtual machine

const (
	MachineTypeBuiltin MachineType = iota
	MachineTypeGoPlugin

	MachineTypesTotalCount
)

Real constants of MachineType

type Object

type Object struct {
	MachineType MachineType
	Reference   Reference
	Data        []byte
}

Object is an inner representation of storage object for transfwering it over API

type Reference

type Reference string

Reference is a contract address

Directories

Path Synopsis
Package goplugin - golang plugin in docker runner
Package goplugin - golang plugin in docker runner
testplugins/foundation
Package foundation emulates foundation of types for golang contracts
Package foundation emulates foundation of types for golang contracts

Jump to

Keyboard shortcuts

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