scenariosConverter

package
v1.4.14 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BenchmarkScenariosSpecificTx

func BenchmarkScenariosSpecificTx(b *testing.B, scenariosTestPath string)

BenchmarkScenariosSpecificTx -

func CheckAccounts

func CheckAccounts(t *testing.T, accAdapter state.AccountsAdapter, scenariosAccounts []*mge.TestAccount)

CheckAccounts will verify if scenariosAccounts correspond to AccountsAdapter accounts

func CheckConverter

func CheckConverter(t *testing.T, scenariosTestPath string)

CheckConverter -

func CheckStorage

func CheckStorage(t *testing.T, dataTrie state.UserAccountHandler, scenariosAccStorage map[string][]byte)

CheckStorage checks if the dataTrie of an account equals with the storage of the corresponding scenariosAccount

func CheckTransactions

func CheckTransactions(t *testing.T, transactions []*transaction.Transaction, scenariosTransactions []*mge.Transaction)

CheckTransactions checks if the transactions correspond with the scenariosTransactions

func CreateAccountsFromScenariosAccs

func CreateAccountsFromScenariosAccs(tc *vm.VMTestContext, scenariosUserAccounts []*mge.TestAccount) error

CreateAccountsFromScenariosAccs uses scenariosAccounts to populate the AccountsAdapter

func CreateTransactionsFromScenariosTxs

func CreateTransactionsFromScenariosTxs(scenariosTxs []*mge.Transaction) (transactions []*transaction.Transaction)

CreateTransactionsFromScenariosTxs converts scenarios transactions intro trasnsactions that can be processed by the txProcessor

func DeploySCsFromScenariosDeployTxs

func DeploySCsFromScenariosDeployTxs(testContext *vm.VMTestContext, deployScenariosTxs []*mge.Transaction) ([][]byte, error)

DeploySCsFromScenariosDeployTxs deploys all smartContracts correspondent to "scDeploy" in a scenarios test, then replaces with the correct computed address in all the transactions.

func ProcessAllTransactions

func ProcessAllTransactions(testContext *vm.VMTestContext, transactions []*transaction.Transaction) error

ProcessAllTransactions -

func ReplaceScenariosScAddressesWithNewScAddresses

func ReplaceScenariosScAddressesWithNewScAddresses(deployedScAccounts []*mge.TestAccount, newScAddresses [][]byte, scenariosTxs []*mge.Transaction)

ReplaceScenariosScAddressesWithNewScAddresses corrects the Scenarios SC Addresses, with the new Addresses obtained from deploying the SCs

func RunSingleTransactionBenchmark

func RunSingleTransactionBenchmark(b *testing.B, testContext *vm.VMTestContext, tx *transaction.Transaction) error

RunSingleTransactionBenchmark receives the VMTestContext (which can be created with SetStateFromScenariosTest), a tx and performs a benchmark on that specific tx. If processing transaction fails, it will return error, else will return nil

func SetStateFromScenariosTest

func SetStateFromScenariosTest(scenariosTestPath string) (testContext *vm.VMTestContext, transactions []*transaction.Transaction, bechmarkTxPos int, err error)

SetStateFromScenariosTest recieves path to scenariosTest, returns a VMTestContext with the specified accounts, an array with the specified transactions and an error

Types

This section is empty.

Jump to

Keyboard shortcuts

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