vm

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountExists

func AccountExists(accnts state.AccountsAdapter, addressBytes []byte) bool

func ComputeExpectedBalance

func ComputeExpectedBalance(
	existing *big.Int,
	transferred *big.Int,
	gasLimit uint64,
	gasPrice uint64,
) *big.Int

func CreateAccount

func CreateAccount(accnts state.AccountsAdapter, pubKey []byte, nonce uint64, balance *big.Int) []byte

func CreateEmptyAddress

func CreateEmptyAddress() state.AddressContainer

func CreateInMemoryShardAccountsDB

func CreateInMemoryShardAccountsDB() *state.AccountsDB

func CreateMemUnit

func CreateMemUnit() storage.Storer

func CreateOneSCExecutorMockVM

func CreateOneSCExecutorMockVM(accnts state.AccountsAdapter) vmcommon.VMExecutionHandler

func CreatePreparedTxProcessorAndAccountsWithIeleVM added in v1.0.3

func CreatePreparedTxProcessorAndAccountsWithIeleVM(
	tb testing.TB,
	senderNonce uint64,
	senderAddressBytes []byte,
	senderBalance *big.Int,
) (process.TransactionProcessor, state.AccountsAdapter, vmcommon.BlockchainHook)

func CreatePreparedTxProcessorAndAccountsWithMockedVM

func CreatePreparedTxProcessorAndAccountsWithMockedVM(
	t *testing.T,
	vmOpGas uint64,
	senderNonce uint64,
	senderAddressBytes []byte,
	senderBalance *big.Int,
) (process.TransactionProcessor, state.AccountsAdapter)

func CreateTx

func CreateTx(
	tb testing.TB,
	senderAddressBytes []byte,
	receiverAddressBytes []byte,
	senderNonce uint64,
	value *big.Int,
	gasPrice uint64,
	gasLimit uint64,
	scCodeOrFunc string,
) *dataTransaction.Transaction

func CreateTxProcessorWithOneSCExecutorIeleVM added in v1.0.3

func CreateTxProcessorWithOneSCExecutorIeleVM(
	accnts state.AccountsAdapter,
) (process.TransactionProcessor, vmcommon.BlockchainHook)

func CreateTxProcessorWithOneSCExecutorMockVM

func CreateTxProcessorWithOneSCExecutorMockVM(accnts state.AccountsAdapter, opGas uint64) process.TransactionProcessor

func CreateVMAndBlockchainHook

func CreateVMAndBlockchainHook(accnts state.AccountsAdapter) (vmcommon.VMExecutionHandler, *hooks.VMAccountsDB)

func GetAccountsBalance

func GetAccountsBalance(addrBytes []byte, accnts state.AccountsAdapter) *big.Int

func TestAccount

func TestAccount(
	t *testing.T,
	accnts state.AccountsAdapter,
	senderAddressBytes []byte,
	expectedNonce uint64,
	expectedBalance *big.Int,
)

func TestDeployedContractContents

func TestDeployedContractContents(
	t *testing.T,
	destinationAddressBytes []byte,
	accnts state.AccountsAdapter,
	requiredBalance *big.Int,
	scCode string,
	dataValues map[string]*big.Int,
)

Types

This section is empty.

Jump to

Keyboard shortcuts

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