Documentation ¶
Index ¶
- Variables
- func CreateHostAndInstanceBuilder(t *testing.T, net *integrationTests.TestNetwork, ...) (map[uint32]map[string]vmhost.VMHost, ...)
- func DeployAndExecuteERC20WithBigInt(numRun int, numTransferInBatch int, gasSchedule map[string]map[string]uint64, ...) ([]time.Duration, error)
- func GetAddressForNewAccount(t *testing.T, net *integrationTests.TestNetwork, ...) ([]byte, state.UserAccountHandler)
- func GetAddressForNewAccountOnWalletAndNode(t *testing.T, net *integrationTests.TestNetwork, ...) ([]byte, state.UserAccountHandler)
- func GetAddressForNewAccountOnWalletAndNodeWithVM(t *testing.T, net *integrationTests.TestNetwork, ...) ([]byte, state.UserAccountHandler)
- func GetAddressForNewAccountWithVM(t *testing.T, net *integrationTests.TestNetwork, ...) ([]byte, state.UserAccountHandler)
- func InitializeMockContracts(t *testing.T, net *integrationTests.TestNetwork, ...)
- func InitializeMockContractsWithVMContainer(t *testing.T, net *integrationTests.TestNetwork, ...)
- func InitializeMockContractsWithVMContainerAndVMTypes(t *testing.T, net *integrationTests.TestNetwork, ...)
- func MakeHeaderHandlerStub(epoch uint32) data.HeaderHandler
- func MakeTestWalletAddress(identifier string) []byte
- func RegisterAsyncCallForMockContract(host vmhost.VMHost, config interface{}, destinationAddress []byte, ...) error
- func RunERC20TransactionSet(testContext *vm.VMTestContext) error
- func RunERC20TransactionsWithBenchmarksInVMTestContext(testContext *vm.VMTestContext, numRun int, numTransferInBatch int, ...) ([]time.Duration, error)
- func SetCodeMetadata(t *testing.T, codeMetadata []byte, node *integrationTests.TestProcessorNode, ...)
- func SetupERC20Test(testContext *vm.VMTestContext, contractCodeFile string) error
- func ValidateERC20TransactionsInVMTestContext(testContext *vm.VMTestContext, numRun int, numTransferInBatch int, ...) error
- type ResultInfo
Constants ¶
This section is empty.
Variables ¶
var EsdtTokenIdentifier = []byte("TTT-010101")
EsdtTokenIdentifier is the token identifier in tests
var InitialEsdt = uint64(100)
InitialEsdt is the initial amount minted for esdt
var MockInitialBalance = big.NewInt(10_000_000)
MockInitialBalance represents a mock balance
var WalletAddressPrefix = []byte("..........")
WalletAddressPrefix is the prefix of any smart contract address used for testing.
Functions ¶
func CreateHostAndInstanceBuilder ¶ added in v1.6.0
func CreateHostAndInstanceBuilder(t *testing.T, net *integrationTests.TestNetwork, vmContainer process.VirtualMachinesContainer, vmKeys [][]byte) (map[uint32]map[string]vmhost.VMHost, map[uint32]map[string]*contextmock.ExecutorMock)
CreateHostAndInstanceBuilder creates a new host and instance builder
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 GetAddressForNewAccount ¶ added in v1.6.0
func GetAddressForNewAccount( t *testing.T, net *integrationTests.TestNetwork, node *integrationTests.TestProcessorNode) ([]byte, state.UserAccountHandler)
GetAddressForNewAccount -
func GetAddressForNewAccountOnWalletAndNode ¶ added in v1.6.0
func GetAddressForNewAccountOnWalletAndNode( t *testing.T, net *integrationTests.TestNetwork, wallet *integrationTests.TestWalletAccount, node *integrationTests.TestProcessorNode, ) ([]byte, state.UserAccountHandler)
GetAddressForNewAccountOnWalletAndNode -
func GetAddressForNewAccountOnWalletAndNodeWithVM ¶ added in v1.6.0
func GetAddressForNewAccountOnWalletAndNodeWithVM( t *testing.T, net *integrationTests.TestNetwork, wallet *integrationTests.TestWalletAccount, node *integrationTests.TestProcessorNode, vmType []byte, ) ([]byte, state.UserAccountHandler)
GetAddressForNewAccountOnWalletAndNodeWithVM -
func GetAddressForNewAccountWithVM ¶ added in v1.6.0
func GetAddressForNewAccountWithVM( t *testing.T, net *integrationTests.TestNetwork, node *integrationTests.TestProcessorNode, vmType []byte) ([]byte, state.UserAccountHandler)
GetAddressForNewAccountWithVM -
func InitializeMockContracts ¶ added in v1.6.0
func InitializeMockContracts( t *testing.T, net *integrationTests.TestNetwork, mockSCs ...testcommon.MockTestSmartContract, )
InitializeMockContracts -
func InitializeMockContractsWithVMContainer ¶ added in v1.6.0
func InitializeMockContractsWithVMContainer( t *testing.T, net *integrationTests.TestNetwork, _ process.VirtualMachinesContainer, mockSCs ...testcommon.MockTestSmartContract, )
InitializeMockContractsWithVMContainer -
func InitializeMockContractsWithVMContainerAndVMTypes ¶ added in v1.6.0
func InitializeMockContractsWithVMContainerAndVMTypes( t *testing.T, net *integrationTests.TestNetwork, vmContainer process.VirtualMachinesContainer, vmKeys [][]byte, mockSCs ...testcommon.MockTestSmartContract, )
InitializeMockContractsWithVMContainerAndVMTypes -
func MakeHeaderHandlerStub ¶
func MakeHeaderHandlerStub(epoch uint32) data.HeaderHandler
MakeHeaderHandlerStub prepares a HeaderHandlerStub with the provided epoch
func MakeTestWalletAddress ¶ added in v1.6.0
MakeTestWalletAddress generates a new wallet address to be used for testing based on the given identifier.
func RegisterAsyncCallForMockContract ¶ added in v1.6.0
func RegisterAsyncCallForMockContract(host vmhost.VMHost, config interface{}, destinationAddress []byte, egldValue []byte, callData *txDataBuilder.TxDataBuilder) error
RegisterAsyncCallForMockContract is resued also in some tests before async context serialization
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 SetCodeMetadata ¶ added in v1.6.0
func SetCodeMetadata( t *testing.T, codeMetadata []byte, node *integrationTests.TestProcessorNode, account state.UserAccountHandler, )
SetCodeMetadata -
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 ¶
ResultInfo will hold the result information after running the tests