vm

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0, BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchHash

func BatchHash(reqids []coretypes.RequestID, ts int64, leaderIndex uint16) hashing.HashValue

BatchHash is used to uniquely identify the VM task

Types

type ContractEventPublisher added in v0.1.0

type ContractEventPublisher struct {
	// contains filtered or unexported fields
}

func NewContractEventPublisher added in v0.1.0

func NewContractEventPublisher(contractID coretypes.ContractID, log *logger.Logger) ContractEventPublisher

func (ContractEventPublisher) Publish added in v0.1.0

func (c ContractEventPublisher) Publish(msg string)

func (ContractEventPublisher) Publishf added in v0.1.0

func (c ContractEventPublisher) Publishf(format string, args ...interface{})

type RequestRefWithFreeTokens added in v0.1.0

type RequestRefWithFreeTokens struct {
	sctransaction.RequestRef
	FreeTokens coretypes.ColoredBalances
}

type VMTask

type VMTask struct {
	Processors *processors.ProcessorCache
	// inputs (immutable)
	ChainID coretypes.ChainID
	Color   balance.Color
	// deterministic source of entropy
	Entropy            hashing.HashValue
	Balances           map[valuetransaction.ID][]*balance.Balance
	ValidatorFeeTarget coretypes.AgentID
	Requests           []RequestRefWithFreeTokens
	Timestamp          int64
	VirtualState       state.VirtualState // input immutable
	Log                *logger.Logger
	// call when finished
	OnFinish func(callResult dict.Dict, callError error, vmError error)
	// outputs
	ResultTransaction *sctransaction.Transaction
	ResultBlock       state.Block
}

task context (for batch of requests)

Directories

Path Synopsis
root
'root' a core contract on the chain.
'root' a core contract on the chain.
testcore/sbtests/sbtestsc
smart contract for testing
smart contract for testing
sandbox_utils
package sb_utils implements Sandbox utility functions
package sb_utils implements Sandbox utility functions
tx builder for VM package to build value transaction for the anchor transaction
tx builder for VM package to build value transaction for the anchor transaction

Jump to

Keyboard shortcuts

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