Documentation ¶
Index ¶
- Variables
- func AddFinishData(vmOutput *vmcommon.VMOutput, data []byte)
- func AddNewOutputAccount(vmOutput *vmcommon.VMOutput, address []byte, balanceDelta int64, data []byte) *vmcommon.OutputAccount
- func DefaultTestContractCallInput() *vmcommon.ContractCallInput
- func DefaultTestContractCreateInput() *vmcommon.ContractCreateInput
- func DefaultTestCore(tb testing.TB, blockchain vmcommon.BlockchainHook) (*vmHost, error)
- func DefaultTestCoreForCall(tb testing.TB, code []byte, balance *big.Int) (*vmHost, *mock.BlockchainHookStub)
- func DefaultTestCoreForDeployment(t *testing.T, _ uint64, newAddress []byte) *vmHost
- func DefaultTestCoreForTwoSCs(t *testing.T, parentCode []byte, childCode []byte, parentSCBalance *big.Int) (*vmHost, *mock.BlockchainHookStub)
- func GetSCCode(fileName string) []byte
- func GetTestSCCode(scName string, prefixToTestSCs string) []byte
- func LoadGasScheduleConfig(filepath string) (config.GasScheduleMap, error)
- func LoadTomlFileToMap(relativePath string) (map[string]interface{}, error)
- func MakeVMOutput() *vmcommon.VMOutput
- func NewCoreVM(blockChainHook vmcommon.BlockchainHook, hostParameters *core.VMHostParameters) (*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 CustomGasSchedule = config.GasScheduleMap(nil)
var MaximumWasmerInstanceCount = uint64(10)
Functions ¶
func AddFinishData ¶
AddFinishData appends the provided []byte to the ReturnData of the given vmOutput
func AddNewOutputAccount ¶
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 DefaultTestContractCallInput ¶
func DefaultTestContractCallInput() *vmcommon.ContractCallInput
DefaultTestContractCallInput creates a vmcommon.ContractCallInput struct with default values
func DefaultTestContractCreateInput ¶
func DefaultTestContractCreateInput() *vmcommon.ContractCreateInput
DefaultTestContractCreateInput creates a vmcommon.ContractCreateInput struct with default values
func DefaultTestCore ¶
func DefaultTestCore(tb testing.TB, blockchain vmcommon.BlockchainHook) (*vmHost, error)
func DefaultTestCoreForCall ¶
func DefaultTestCoreForDeployment ¶
DefaultTestCoreForDeployment creates an Core vmHost configured for testing deployments
func DefaultTestCoreForTwoSCs ¶
func DefaultTestCoreForTwoSCs(t *testing.T, parentCode []byte, childCode []byte, parentSCBalance *big.Int) (*vmHost, *mock.BlockchainHookStub)
DefaultTestCoreForTwoSCs creates an Core vmHost configured for testing calls between 2 SmartContracts
func GetTestSCCode ¶
GetTestSCCode retrieves the bytecode of a WASM testing module
func LoadGasScheduleConfig ¶
func LoadGasScheduleConfig(filepath string) (config.GasScheduleMap, error)
func LoadTomlFileToMap ¶
LoadTomlFileToMap opens and decodes a toml file as a map[string]interface{}
func MakeVMOutput ¶
MakeVMOutput creates a vmcommon.VMOutput struct with default values
func NewCoreVM ¶
func NewCoreVM( blockChainHook vmcommon.BlockchainHook, hostParameters *core.VMHostParameters, ) (*vmHost, error)
NewCoreVM creates a new Core vmHost
func SetStorageUpdate ¶
func SetStorageUpdate(account *vmcommon.OutputAccount, key []byte, data []byte)
SetStorageUpdate sets a storage update to the provided vmcommon.OutputAccount
func SetStorageUpdateStrings ¶
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