host

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCodeNotFound = errors.New("code not found")

Functions

func AddFinishData added in v0.3.8

func AddFinishData(vmOutput *vmcommon.VMOutput, data []byte)

func AddNewOutputAccount added in v0.3.8

func AddNewOutputAccount(vmOutput *vmcommon.VMOutput, address []byte, balanceDelta int64, data []byte) *vmcommon.OutputAccount

func DefaultTestArwen added in v0.3.8

func DefaultTestArwen(t *testing.T, blockchain vmcommon.BlockchainHook, crypto vmcommon.CryptoHook) (*vmHost, error)

func DefaultTestArwenForCall added in v0.3.8

func DefaultTestArwenForCall(t *testing.T, code []byte) (*vmHost, *mock.BlockchainHookStub)

func DefaultTestArwenForDeployment added in v0.3.8

func DefaultTestArwenForDeployment(t *testing.T, ownerNonce uint64, newAddress []byte) *vmHost

func DefaultTestArwenForTwoSCs added in v0.3.8

func DefaultTestArwenForTwoSCs(t *testing.T, firstCode []byte, secondCode []byte) (*vmHost, *mock.BlockchainHookStub)

func DefaultTestContractCallInput added in v0.3.8

func DefaultTestContractCallInput() *vmcommon.ContractCallInput

func DefaultTestContractCreateInput added in v0.3.8

func DefaultTestContractCreateInput() *vmcommon.ContractCreateInput

func GetSCCode added in v0.3.8

func GetSCCode(fileName string) []byte

func GetTestSCCode added in v0.3.8

func GetTestSCCode(scName string, prefixToTestSCs string) []byte

func MakeVMOutput added in v0.3.8

func MakeVMOutput() *vmcommon.VMOutput

func NewArwenVM

func NewArwenVM(
	blockChainHook vmcommon.BlockchainHook,
	cryptoHook vmcommon.CryptoHook,
	vmType []byte,
	blockGasLimit uint64,
	gasSchedule map[string]map[string]uint64,
) (*vmHost, error)

func SetStorageUpdate added in v0.3.8

func SetStorageUpdate(account *vmcommon.OutputAccount, key []byte, data []byte)

func SetStorageUpdateStrings added in v0.3.8

func SetStorageUpdateStrings(account *vmcommon.OutputAccount, key string, data string)

func TryCatch

func TryCatch(try TryFunction, catch CatchFunction, catchFallbackMessage string)

TryCatch simulates a try/catch block using golang's recover() functionality

Types

type CatchFunction

type CatchFunction func(error)

CatchFunction corresponds to the catch() part of a try / catch block

type TryFunction

type TryFunction func()

TryFunction corresponds to the try() part of a try / catch block

Jump to

Keyboard shortcuts

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