exec

package
v0.0.0-...-ee306bc Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell interface {
	cells.Cell

	// Parent - Parent cell.
	Parent() cells.Cell

	// ExecChild - Child cell by index.
	ExecChild(int) Cell

	// Context - Execution context.
	Context() context.Context

	// WithContext - Cell with context.
	WithContext(context.Context) Cell
}

Cell - Cell during execution.

func NewCell

func NewCell(ctx context.Context, parent, cell cells.Cell) Cell

NewCell - Creates new exec cell.

func NewRoot

func NewRoot(ctx context.Context, cell cells.Cell) Cell

NewRoot - Creates new root exec cell.

type State

type State interface {
	// Op - Execution cell.
	Op() Cell

	// Block - Chain block.
	Block() *chain.Block

	// Store - Execution state.
	Store() Store

	// WithOp - Switches op cell.
	WithOp(Cell) State
}

State - Execution stack context.

func NewState

func NewState(store Store, block *chain.Block) State

NewState - Creates new execution state.

func NextState

func NextState(state State, execRoot cells.MutableCell) (State, error)

NextState - Creates state for next block from prev state and exec root.

func Unwind

func Unwind(state State) (State, error)

Unwind - Unwinds execution of cells.

type Store

type Store interface {
	// Get - Gets value under key.
	Get(key *cells.CID) (uint64, error)

	// Update - Updates value under key.
	Update(key *cells.CID, value uint64) error

	// Total - Total power.
	Total() uint64

	// Commit - Saves store state to database.
	Commit() (*cells.CID, error)

	// Clone - Clones store with current state.
	Clone() (Store, error)
}

Store - Execution store.

func NewStore

func NewStore(state *cells.CID, triedb *trie.Database) (_ Store, err error)

NewStore - Creates new mutable execution store.

Jump to

Keyboard shortcuts

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