Documentation ¶
Index ¶
- func AccountExists(accnts state.AccountsAdapter, addressBytes []byte) bool
- func ComputeExpectedBalance(existing *big.Int, transferred *big.Int, gasLimit uint64, gasPrice uint64) *big.Int
- func ComputeGasLimit(gasSchedule map[string]map[string]uint64, testContext *VMTestContext, ...) uint64
- func CreateAccount(accnts state.AccountsAdapter, pubKey []byte, nonce uint64, balance *big.Int) ([]byte, error)
- func CreateDeployTx(senderAddressBytes []byte, senderNonce uint64, value *big.Int, gasPrice uint64, ...) *dataTransaction.Transaction
- func CreateEmptyAddress() []byte
- func CreateInMemoryShardAccountsDB() *state.AccountsDB
- func CreateMemUnit() storage.Storer
- func CreateOneSCExecutorMockVM(accnts state.AccountsAdapter) vmcommon.VMExecutionHandler
- func CreatePreparedTxProcessorAndAccountsWithMockedVM(vmOpGas uint64, senderNonce uint64, senderAddressBytes []byte, ...) (process.TransactionProcessor, state.AccountsAdapter, error)
- func CreateTestIndexer(t testing.TB, coordinator sharding.Coordinator, ...) *testIndexer
- func CreateTransaction(nonce uint64, value *big.Int, sndAddress []byte, rcvAddress []byte, ...) *dataTransaction.Transaction
- func CreateTransferTokenTx(nonce uint64, functionName string, value *big.Int, scAddrress []byte, ...) *dataTransaction.Transaction
- func CreateTx(senderAddressBytes []byte, receiverAddressBytes []byte, senderNonce uint64, ...) *dataTransaction.Transaction
- func CreateTxProcessorWithOneSCExecutorMockVM(accnts state.AccountsAdapter, opGas uint64, argEnableEpoch ArgEnableEpoch, ...) (process.TransactionProcessor, error)
- func CreateTxProcessorWithOneSCExecutorWithVMs(accnts state.AccountsAdapter, vmContainer process.VirtualMachinesContainer, ...) (process.TransactionProcessor, *smartContract.TestScProcessor, ...)
- func CreateVMAndBlockchainHook(accnts state.AccountsAdapter, gasSchedule map[string]map[string]uint64, ...) (process.VirtualMachinesContainer, *hooks.BlockChainHookImpl)
- func CreateVMAndBlockchainHookMeta(accnts state.AccountsAdapter, gasSchedule map[string]map[string]uint64, ...) (process.VirtualMachinesContainer, *hooks.BlockChainHookImpl)
- func GetIntValueFromSC(gasSchedule map[string]map[string]uint64, accnts state.AccountsAdapter, ...) *big.Int
- func GetNodeIndex(nodeList []*integrationTests.TestProcessorNode, ...) (int, error)
- func GetVmOutput(gasSchedule map[string]map[string]uint64, accnts state.AccountsAdapter, ...) *vmcommon.VMOutput
- func TestAccount(t *testing.T, accnts state.AccountsAdapter, senderAddressBytes []byte, ...) *big.Int
- func TestDeployedContractContents(t *testing.T, destinationAddressBytes []byte, accnts state.AccountsAdapter, ...)
- type ArgEnableEpoch
- type VMTestAccount
- type VMTestContext
- func CreatePreparedTxProcessorAndAccountsWithVMs(senderNonce uint64, senderAddressBytes []byte, senderBalance *big.Int, ...) (*VMTestContext, error)
- func CreatePreparedTxProcessorWithVMs(argEnableEpoch ArgEnableEpoch) (*VMTestContext, error)
- func CreatePreparedTxProcessorWithVMsMultiShard(selfShardID uint32, argEnableEpoch ArgEnableEpoch) (*VMTestContext, error)
- func CreateTxProcessorArwenVMWithGasSchedule(senderNonce uint64, senderAddressBytes []byte, senderBalance *big.Int, ...) (*VMTestContext, error)
- func CreateTxProcessorArwenWithVMConfig(argEnableEpoch ArgEnableEpoch, vmConfig *config.VirtualMachineConfig, ...) (*VMTestContext, error)
- func (vmTestContext *VMTestContext) Close()
- func (vmTestContext *VMTestContext) CreateAccount(account *VMTestAccount)
- func (vmTestContext *VMTestContext) CreateBlockStarted()
- func (vmTestContext *VMTestContext) CreateTransaction(sender *VMTestAccount, receiver *VMTestAccount, value *big.Int, ...) *dataTransaction.Transaction
- func (vmTestContext *VMTestContext) CreateTransferTokenTx(sender *VMTestAccount, receiver *VMTestAccount, value *big.Int, ...) *dataTransaction.Transaction
- func (vmTestContext *VMTestContext) GetGasRemaining() uint64
- func (vmTestContext *VMTestContext) GetIntValueFromSCWithTransientVM(funcName string, args ...[]byte) *big.Int
- func (vmTestContext *VMTestContext) GetIntermediateTransactions(t *testing.T) []data.TransactionHandler
- func (vmTestContext *VMTestContext) GetLatestError() error
- func (vmTestContext *VMTestContext) GetVMOutputWithTransientVM(funcName string, args ...[]byte) *vmcommon.VMOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccountExists ¶
func AccountExists(accnts state.AccountsAdapter, addressBytes []byte) bool
AccountExists -
func ComputeExpectedBalance ¶
func ComputeExpectedBalance( existing *big.Int, transferred *big.Int, gasLimit uint64, gasPrice uint64, ) *big.Int
ComputeExpectedBalance -
func ComputeGasLimit ¶ added in v1.1.32
func ComputeGasLimit(gasSchedule map[string]map[string]uint64, testContext *VMTestContext, tx *dataTx.Transaction) uint64
ComputeGasLimit -
func CreateAccount ¶
func CreateAccount(accnts state.AccountsAdapter, pubKey []byte, nonce uint64, balance *big.Int) ([]byte, error)
CreateAccount -
func CreateDeployTx ¶
func CreateDeployTx( senderAddressBytes []byte, senderNonce uint64, value *big.Int, gasPrice uint64, gasLimit uint64, scCodeAndVMType string, ) *dataTransaction.Transaction
CreateDeployTx -
func CreateInMemoryShardAccountsDB ¶
func CreateInMemoryShardAccountsDB() *state.AccountsDB
CreateInMemoryShardAccountsDB -
func CreateOneSCExecutorMockVM ¶
func CreateOneSCExecutorMockVM(accnts state.AccountsAdapter) vmcommon.VMExecutionHandler
CreateOneSCExecutorMockVM -
func CreatePreparedTxProcessorAndAccountsWithMockedVM ¶
func CreatePreparedTxProcessorAndAccountsWithMockedVM( vmOpGas uint64, senderNonce uint64, senderAddressBytes []byte, senderBalance *big.Int, argEnableEpoch ArgEnableEpoch, arwenChangeLocker process.Locker, ) (process.TransactionProcessor, state.AccountsAdapter, error)
CreatePreparedTxProcessorAndAccountsWithMockedVM -
func CreateTestIndexer ¶ added in v1.1.22
func CreateTestIndexer( t testing.TB, coordinator sharding.Coordinator, economicsDataHandler process.EconomicsDataHandler, ) *testIndexer
CreateTestIndexer -
func CreateTransaction ¶ added in v1.1.15
func CreateTransaction( nonce uint64, value *big.Int, sndAddress []byte, rcvAddress []byte, gasprice uint64, gasLimit uint64, data []byte, ) *dataTransaction.Transaction
CreateTransaction -
func CreateTransferTokenTx ¶
func CreateTransferTokenTx( nonce uint64, functionName string, value *big.Int, scAddrress []byte, sndAddress []byte, rcvAddress []byte, ) *dataTransaction.Transaction
CreateTransferTokenTx -
func CreateTx ¶
func CreateTx( senderAddressBytes []byte, receiverAddressBytes []byte, senderNonce uint64, value *big.Int, gasPrice uint64, gasLimit uint64, scCodeOrFunc string, ) *dataTransaction.Transaction
CreateTx -
func CreateTxProcessorWithOneSCExecutorMockVM ¶
func CreateTxProcessorWithOneSCExecutorMockVM( accnts state.AccountsAdapter, opGas uint64, argEnableEpoch ArgEnableEpoch, arwenChangeLocker process.Locker, ) (process.TransactionProcessor, error)
CreateTxProcessorWithOneSCExecutorMockVM -
func CreateTxProcessorWithOneSCExecutorWithVMs ¶
func CreateTxProcessorWithOneSCExecutorWithVMs( accnts state.AccountsAdapter, vmContainer process.VirtualMachinesContainer, blockChainHook *hooks.BlockChainHookImpl, feeAccumulator process.TransactionFeeHandler, shardCoordinator sharding.Coordinator, argEnableEpoch ArgEnableEpoch, arwenChangeLocker process.Locker, ) (process.TransactionProcessor, *smartContract.TestScProcessor, process.IntermediateTransactionHandler, process.EconomicsDataHandler, error)
CreateTxProcessorWithOneSCExecutorWithVMs -
func CreateVMAndBlockchainHook ¶
func CreateVMAndBlockchainHook( accnts state.AccountsAdapter, gasSchedule map[string]map[string]uint64, vmConfig *config.VirtualMachineConfig, shardCoordinator sharding.Coordinator, arwenChangeLocker process.Locker, ) (process.VirtualMachinesContainer, *hooks.BlockChainHookImpl)
CreateVMAndBlockchainHook -
func CreateVMAndBlockchainHookMeta ¶ added in v1.1.34
func CreateVMAndBlockchainHookMeta( accnts state.AccountsAdapter, gasSchedule map[string]map[string]uint64, shardCoordinator sharding.Coordinator, arg ArgEnableEpoch, ) (process.VirtualMachinesContainer, *hooks.BlockChainHookImpl)
CreateVMAndBlockchainHookMeta -
func GetIntValueFromSC ¶
func GetIntValueFromSC( gasSchedule map[string]map[string]uint64, accnts state.AccountsAdapter, scAddressBytes []byte, funcName string, args ...[]byte, ) *big.Int
GetIntValueFromSC -
func GetNodeIndex ¶ added in v1.1.15
func GetNodeIndex(nodeList []*integrationTests.TestProcessorNode, node *integrationTests.TestProcessorNode) (int, error)
GetNodeIndex -
func GetVmOutput ¶ added in v1.1.22
func GetVmOutput(gasSchedule map[string]map[string]uint64, accnts state.AccountsAdapter, scAddressBytes []byte, funcName string, args ...[]byte) *vmcommon.VMOutput
GetVmOutput -
Types ¶
type ArgEnableEpoch ¶ added in v1.1.16
type ArgEnableEpoch struct { PenalizedTooMuchGasEnableEpoch uint32 BuiltinEnableEpoch uint32 DeployEnableEpoch uint32 MetaProtectionEnableEpoch uint32 RelayedTxEnableEpoch uint32 UnbondTokensV2EnableEpoch uint32 }
ArgEnableEpoch will specify the enable epoch values for certain flags
type VMTestAccount ¶ added in v1.2.1
VMTestAccount -
type VMTestContext ¶ added in v0.0.5
type VMTestContext struct { TxProcessor process.TransactionProcessor ScProcessor *smartContract.TestScProcessor Accounts state.AccountsAdapter BlockchainHook vmcommon.BlockchainHook VMContainer process.VirtualMachinesContainer TxFeeHandler process.TransactionFeeHandler ShardCoordinator sharding.Coordinator ScForwarder process.IntermediateTransactionHandler EconomicsData process.EconomicsDataHandler Marshalizer marshal.Marshalizer GasSchedule map[string]map[string]uint64 VMConfiguration *config.VirtualMachineConfig EpochNotifier process.EpochNotifier SCQueryService *smartContract.SCQueryService Alice VMTestAccount Bob VMTestAccount ContractOwner VMTestAccount Contract VMTestAccount }
VMTestContext -
func CreatePreparedTxProcessorAndAccountsWithVMs ¶
func CreatePreparedTxProcessorAndAccountsWithVMs( senderNonce uint64, senderAddressBytes []byte, senderBalance *big.Int, argEnableEpoch ArgEnableEpoch, ) (*VMTestContext, error)
CreatePreparedTxProcessorAndAccountsWithVMs -
func CreatePreparedTxProcessorWithVMs ¶ added in v1.1.15
func CreatePreparedTxProcessorWithVMs(argEnableEpoch ArgEnableEpoch) (*VMTestContext, error)
CreatePreparedTxProcessorWithVMs -
func CreatePreparedTxProcessorWithVMsMultiShard ¶ added in v1.1.15
func CreatePreparedTxProcessorWithVMsMultiShard(selfShardID uint32, argEnableEpoch ArgEnableEpoch) (*VMTestContext, error)
CreatePreparedTxProcessorWithVMsMultiShard -
func CreateTxProcessorArwenVMWithGasSchedule ¶
func CreateTxProcessorArwenVMWithGasSchedule( senderNonce uint64, senderAddressBytes []byte, senderBalance *big.Int, gasSchedule map[string]map[string]uint64, argEnableEpoch ArgEnableEpoch, ) (*VMTestContext, error)
CreateTxProcessorArwenVMWithGasSchedule -
func CreateTxProcessorArwenWithVMConfig ¶ added in v1.2.1
func CreateTxProcessorArwenWithVMConfig( argEnableEpoch ArgEnableEpoch, vmConfig *config.VirtualMachineConfig, gasSchedule map[string]map[string]uint64, ) (*VMTestContext, error)
CreateTxProcessorArwenWithVMConfig -
func (*VMTestContext) CreateAccount ¶ added in v1.2.1
func (vmTestContext *VMTestContext) CreateAccount(account *VMTestAccount)
CreateAccount -
func (*VMTestContext) CreateBlockStarted ¶ added in v1.1.25
func (vmTestContext *VMTestContext) CreateBlockStarted()
CreateBlockStarted -
func (*VMTestContext) CreateTransaction ¶ added in v1.2.1
func (vmTestContext *VMTestContext) CreateTransaction( sender *VMTestAccount, receiver *VMTestAccount, value *big.Int, gasprice uint64, gasLimit uint64, data []byte, ) *dataTransaction.Transaction
CreateTransaction -
func (*VMTestContext) CreateTransferTokenTx ¶ added in v1.2.1
func (vmTestContext *VMTestContext) CreateTransferTokenTx( sender *VMTestAccount, receiver *VMTestAccount, value *big.Int, functionName string, ) *dataTransaction.Transaction
CreateTransferTokenTx -
func (*VMTestContext) GetGasRemaining ¶ added in v1.1.12
func (vmTestContext *VMTestContext) GetGasRemaining() uint64
GetGasRemaining -
func (*VMTestContext) GetIntValueFromSCWithTransientVM ¶ added in v1.2.1
func (vmTestContext *VMTestContext) GetIntValueFromSCWithTransientVM(funcName string, args ...[]byte) *big.Int
GetIntValueFromSCWithTransientVM -
func (*VMTestContext) GetIntermediateTransactions ¶ added in v1.1.16
func (vmTestContext *VMTestContext) GetIntermediateTransactions(t *testing.T) []data.TransactionHandler
GetIntermediateTransactions -
func (*VMTestContext) GetLatestError ¶ added in v1.0.103
func (vmTestContext *VMTestContext) GetLatestError() error
GetLatestError -
func (*VMTestContext) GetVMOutputWithTransientVM ¶ added in v1.2.1
func (vmTestContext *VMTestContext) GetVMOutputWithTransientVM(funcName string, args ...[]byte) *vmcommon.VMOutput
GetVMOutputWithTransientVM -