wasmvm

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeployAndExecuteERC20WithBigInt

func DeployAndExecuteERC20WithBigInt(
	numRun int,
	numTransferInBatch int,
	gasSchedule map[string]map[string]uint64,
	fileName string,
	functionName string,
) ([]time.Duration, error)

DeployAndExecuteERC20WithBigInt will stress test the erc20 contract

func MakeHeaderHandlerStub

func MakeHeaderHandlerStub(epoch uint32) data.HeaderHandler

MakeHeaderHandlerStub prepares a HeaderHandlerStub with the provided epoch

func RunERC20TransactionSet

func RunERC20TransactionSet(testContext *vm.VMTestContext) error

RunERC20TransactionSet performs a predetermined set of ERC20 token transfers

func RunERC20TransactionsWithBenchmarksInVMTestContext

func RunERC20TransactionsWithBenchmarksInVMTestContext(
	testContext *vm.VMTestContext,
	numRun int,
	numTransferInBatch int,
	functionName string,
	transferOnCalls *big.Int,
) ([]time.Duration, error)

RunERC20TransactionsWithBenchmarksInVMTestContext executes a configurable set of ERC20 token transfers

func SetupERC20Test

func SetupERC20Test(
	testContext *vm.VMTestContext,
	contractCodeFile string,
) error

SetupERC20Test prepares an ERC20 contract and the accounts to transfer tokens between

func ValidateERC20TransactionsInVMTestContext

func ValidateERC20TransactionsInVMTestContext(
	testContext *vm.VMTestContext,
	numRun int,
	numTransferInBatch int,
	transferOnCalls *big.Int,
) error

ValidateERC20TransactionsInVMTestContext verifies whether the ERC20 transfers were executed correctly

Types

type ResultInfo

type ResultInfo struct {
	FunctionName      string
	GasUsed           uint64
	ExecutionTimeSpan time.Duration
}

ResultInfo will hold the result information after running the tests

func RunTest

func RunTest(
	fileSC string,
	testingValue uint64,
	function string,
	arguments [][]byte,
	numRun int,
	gasSchedule map[string]map[string]uint64,
	txGasLimit uint64,
) (ResultInfo, error)

RunTest runs a test with the provided parameters

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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