Documentation ¶
Index ¶
- Variables
- func AddFinishData(vmOutput *vmcommon.VMOutput, data []byte)
- func AddNewOutputAccount(vmOutput *vmcommon.VMOutput, address []byte, balanceDelta int64, data []byte) *vmcommon.OutputAccount
- func DefaultTestArwen(tb testing.TB, blockchain vmcommon.BlockchainHook, crypto vmcommon.CryptoHook) (*vmHost, error)
- func DefaultTestArwenForCall(tb testing.TB, code []byte) (*vmHost, *mock.BlockchainHookStub)
- func DefaultTestArwenForDeployment(t *testing.T, ownerNonce uint64, newAddress []byte) *vmHost
- func DefaultTestArwenForTwoSCs(t *testing.T, parentCode []byte, childCode []byte) (*vmHost, *mock.BlockchainHookStub)
- func DefaultTestContractCallInput() *vmcommon.ContractCallInput
- func DefaultTestContractCreateInput() *vmcommon.ContractCreateInput
- func GetSCCode(fileName string) []byte
- func GetTestSCCode(scName string, prefixToTestSCs string) []byte
- func LoadGasScheduleConfig(filepath string) (config.GasScheduleMap, error)
- func LoadTomlFile(dest interface{}, relativePath string) error
- func LoadTomlFileToMap(relativePath string) (map[string]interface{}, error)
- func MakeVMOutput() *vmcommon.VMOutput
- func NewArwenVM(blockChainHook vmcommon.BlockchainHook, cryptoHook vmcommon.CryptoHook, ...) (*vmHost, error)
- func OpenFile(relativePath string) (*os.File, error)
- func SetStorageUpdate(account *vmcommon.OutputAccount, key []byte, data []byte)
- func SetStorageUpdateStrings(account *vmcommon.OutputAccount, key string, data string)
- func TryCatch(try TryFunction, catch CatchFunction, catchFallbackMessage string)
- type CatchFunction
- type TryFunction
Constants ¶
This section is empty.
Variables ¶
var MaximumWasmerInstanceCount = uint64(10)
Functions ¶
func AddFinishData ¶ added in v0.3.8
AddFinishData appends the provided []byte to the ReturnData of the given vmOutput
func AddNewOutputAccount ¶ added in v0.3.8
func AddNewOutputAccount(vmOutput *vmcommon.VMOutput, address []byte, balanceDelta int64, data []byte) *vmcommon.OutputAccount
AddNewOutputAccount creates a new vmcommon.OutputAccount from the provided arguments and adds it to OutputAccounts of the provided vmOutput
func DefaultTestArwen ¶ added in v0.3.8
func DefaultTestArwen(tb testing.TB, blockchain vmcommon.BlockchainHook, crypto vmcommon.CryptoHook) (*vmHost, error)
func DefaultTestArwenForCall ¶ added in v0.3.8
func DefaultTestArwenForCall(tb testing.TB, code []byte) (*vmHost, *mock.BlockchainHookStub)
func DefaultTestArwenForDeployment ¶ added in v0.3.8
DefaultTestArwenForDeployment creates an Arwen vmHost configured for testing deployments
func DefaultTestArwenForTwoSCs ¶ added in v0.3.8
func DefaultTestArwenForTwoSCs(t *testing.T, parentCode []byte, childCode []byte) (*vmHost, *mock.BlockchainHookStub)
DefaultTestArwenForTwoSCs creates an Arwen vmHost configured for testing calls between 2 SmartContracts
func DefaultTestContractCallInput ¶ added in v0.3.8
func DefaultTestContractCallInput() *vmcommon.ContractCallInput
DefaultTestContractCallInput creates a vmcommon.ContractCallInput struct with default values
func DefaultTestContractCreateInput ¶ added in v0.3.8
func DefaultTestContractCreateInput() *vmcommon.ContractCreateInput
DefaultTestContractCreateInput creates a vmcommon.ContractCreateInput struct with default values
func GetTestSCCode ¶ added in v0.3.8
GetTestSCCode retrieves the bytecode of a WASM testing module
func LoadGasScheduleConfig ¶ added in v0.3.12
func LoadGasScheduleConfig(filepath string) (config.GasScheduleMap, error)
func LoadTomlFile ¶ added in v0.3.12
LoadTomlFile method to open and decode toml file
func LoadTomlFileToMap ¶ added in v0.3.12
LoadTomlFileToMap opens and decodes a toml file as a map[string]interface{}
func MakeVMOutput ¶ added in v0.3.8
MakeVMOutput creates a vmcommon.VMOutput struct with default values
func NewArwenVM ¶
func NewArwenVM( blockChainHook vmcommon.BlockchainHook, cryptoHook vmcommon.CryptoHook, hostParameters *arwen.VMHostParameters, ) (*vmHost, error)
NewArwenVM creates a new Arwen vmHost
func OpenFile ¶ added in v0.3.12
OpenFile method opens the file from given path - does not close the file
func SetStorageUpdate ¶ added in v0.3.8
func SetStorageUpdate(account *vmcommon.OutputAccount, key []byte, data []byte)
SetStorageUpdate sets a storage update to the provided vmcommon.OutputAccount
func SetStorageUpdateStrings ¶ added in v0.3.8
func SetStorageUpdateStrings(account *vmcommon.OutputAccount, key string, data string)
SetStorageUpdateStrings sets a storage update to the provided vmcommon.OutputAccount, from string arguments
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