vm

package
v1.0.100 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: GPL-3.0 Imports: 29 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

AccountExists -

func ComputeExpectedBalance

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

ComputeExpectedBalance -

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 []byte,
) *dataTransaction.Transaction

CreateDeployTx -

func CreateEmptyAddress

func CreateEmptyAddress() state.AddressContainer

CreateEmptyAddress -

func CreateInMemoryShardAccountsDB

func CreateInMemoryShardAccountsDB() *state.AccountsDB

CreateInMemoryShardAccountsDB -

func CreateMemUnit

func CreateMemUnit() storage.Storer

CreateMemUnit -

func CreateMoveBalanceTx

func CreateMoveBalanceTx(
	nonce uint64,
	value *big.Int,
	sndAddress []byte,
	rcvAddress []byte,
	gasLimit uint64,
) *dataTransaction.Transaction

CreateMoveBalanceTx -

func CreateOneSCExecutorMockVM

func CreateOneSCExecutorMockVM(accnts state.AccountsAdapter) vmcommon.VMExecutionHandler

CreateOneSCExecutorMockVM -

func CreatePreparedTxProcessorAndAccountsWithMockedVM

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

CreatePreparedTxProcessorAndAccountsWithMockedVM -

func CreatePreparedTxProcessorAndAccountsWithVMs

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

CreatePreparedTxProcessorAndAccountsWithVMs -

func CreateTransferTokenTx

func CreateTransferTokenTx(
	nonce uint64,
	value *big.Int,
	scAddrress []byte,
	sndAddress []byte,
	rcvAddress []byte,
) *dataTransaction.Transaction

CreateTransferTokenTx -

func CreateTransferTx

func CreateTransferTx(
	nonce uint64,
	value *big.Int,
	scAddrress []byte,
	sndAddress []byte,
	rcvAddress []byte,
) *dataTransaction.Transaction

CreateTransferTx -

func CreateTx

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

CreateTx -

func CreateTxProcessorArwenVMWithGasSchedule

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

CreateTxProcessorArwenVMWithGasSchedule -

func CreateTxProcessorWithOneSCExecutorMockVM

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

CreateTxProcessorWithOneSCExecutorMockVM -

func CreateTxProcessorWithOneSCExecutorWithVMs

func CreateTxProcessorWithOneSCExecutorWithVMs(
	accnts state.AccountsAdapter,
	vmContainer process.VirtualMachinesContainer,
	blockChainHook *hooks.BlockChainHookImpl,
) process.TransactionProcessor

CreateTxProcessorWithOneSCExecutorWithVMs -

func CreateVMAndBlockchainHook

func CreateVMAndBlockchainHook(
	accnts state.AccountsAdapter,
	gasSchedule map[string]map[string]uint64,
) (process.VirtualMachinesContainer, *hooks.BlockChainHookImpl)

CreateVMAndBlockchainHook -

func FillGasMapBaseOperationCosts

func FillGasMapBaseOperationCosts(value uint64) map[string]uint64

FillGasMapBaseOperationCosts -

func FillGasMapBuiltInCosts

func FillGasMapBuiltInCosts(value uint64) map[string]uint64

FillGasMapBuiltInCosts -

func FillGasMapInternal

func FillGasMapInternal(gasMap map[string]map[string]uint64, value uint64) map[string]map[string]uint64

FillGasMapInternal -

func FillGasMapMetaChainSystemSCsCosts

func FillGasMapMetaChainSystemSCsCosts(value uint64) map[string]uint64

FillGasMapMetaChainSystemSCsCosts -

func GetAccountsBalance

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

GetAccountsBalance -

func GetIntValueFromSC

func GetIntValueFromSC(gasSchedule map[string]map[string]uint64, accnts state.AccountsAdapter, scAddressBytes []byte, funcName string, args ...[]byte) *big.Int

GetIntValueFromSC -

func TestAccount

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

TestAccount -

func TestDeployedContractContents

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

TestDeployedContractContents -

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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