interop

package
v0.90.0-pre Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Chain         blockchainer.Blockchainer
	Trigger       trigger.Type
	Block         *block.Block
	Tx            *transaction.Transaction
	DAO           *dao.Cached
	Notifications []state.NotificationEvent
	Log           *zap.Logger
}

Context represents context in which interops are executed.

func NewContext

func NewContext(trigger trigger.Type, bc blockchainer.Blockchainer, d dao.DAO, block *block.Block, tx *transaction.Transaction, log *zap.Logger) *Context

NewContext returns new interop context.

type Function

type Function struct {
	ID    uint32
	Name  string
	Func  func(*Context, *vm.VM) error
	Price int
}

Function binds function name, id with the function itself and price, it's supposed to be inited once for all interopContexts, so it doesn't use vm.InteropFuncPrice directly.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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