Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(eds ...ExternalDispatcher)

    Connect ExternalDispatchers eds to each other so that the underlying engines can mutually call contracts hosted by other dispatchers

    Types

    type Blockchain

    type Blockchain interface {
    	LastBlockHeight() uint64
    	LastBlockTime() time.Time
    	BlockHash(height uint64) ([]byte, error)
    }

    type CallFrame

    type CallFrame struct {
    	// Cache this State wraps
    	*acmstate.Cache
    	// contains filtered or unexported fields
    }

    func NewCallFrame

    func NewCallFrame(st acmstate.ReaderWriter, cacheOptions ...acmstate.CacheOption) *CallFrame

      Create a new CallFrame to hold state updates at a particular level in the call stack

      func (*CallFrame) CallStackDepth

      func (st *CallFrame) CallStackDepth() uint64

      func (*CallFrame) NewFrame

      func (st *CallFrame) NewFrame(cacheOptions ...acmstate.CacheOption) (*CallFrame, error)

      func (*CallFrame) ReadOnly

      func (st *CallFrame) ReadOnly() *CallFrame

        Put this CallFrame in permanent read-only mode

        func (*CallFrame) Sync

        func (st *CallFrame) Sync() error

        func (*CallFrame) WithMaxCallStackDepth

        func (st *CallFrame) WithMaxCallStackDepth(max uint64) *CallFrame

        type CallParams

        type CallParams struct {
        	CallType exec.CallType
        	Origin   crypto.Address
        	Caller   crypto.Address
        	Callee   crypto.Address
        	Input    []byte
        	Value    uint64
        	Gas      *uint64
        }

        type Callable

        type Callable interface {
        	Call(state State, params CallParams) (output []byte, err error)
        }

          Effectively a contract, but can either represent a single function or a contract with multiple functions and a selector

          type CallableFunc

          type CallableFunc func(st State, params CallParams) (output []byte, err error)

          func (CallableFunc) Call

          func (c CallableFunc) Call(state State, params CallParams) (output []byte, err error)

          type Dispatcher

          type Dispatcher interface {
          	// If this Dispatcher is capable of dispatching this account (e.g. if it has the correct bytecode) then return a
          	// Callable that wraps the function, otherwise return nil
          	Dispatch(acc *acm.Account) Callable
          }

          type Dispatchers

          type Dispatchers []Dispatcher

          func NewDispatchers

          func NewDispatchers(dispatchers ...Dispatcher) Dispatchers

          func (Dispatchers) Dispatch

          func (ds Dispatchers) Dispatch(acc *acm.Account) Callable

          type ExternalDispatcher

          type ExternalDispatcher interface {
          	Dispatcher
          	SetExternals(externals Dispatcher)
          }

            An ExternalDispatcher is able to Dispatch accounts to external engines as well as Dispatch to itself

            type State

            type State struct {
            	*CallFrame
            	Blockchain
            	exec.EventSink
            }