arwen

package
v1.1.46 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const DummyCodeMetadataHex = "0102"

DummyCodeMetadataHex -

View Source
const VMTypeHex = "0500"

VMTypeHex -

Variables

View Source
var DNSAddresses = make(map[string]struct{})

DNSAddresses --

View Source
var GasSchedulePath = "../../../../cmd/node/config/gasSchedules/gasScheduleV2.toml"

GasSchedulePath --

Functions

func CreateDeployTxData added in v1.0.103

func CreateDeployTxData(scCode string) string

CreateDeployTxData -

func CreateDeployTxDataNonPayable added in v1.1.39

func CreateDeployTxDataNonPayable(scCode string) string

CreateDeployTxDataNonPayable -

func FormatHexNumber

func FormatHexNumber(number uint64) string

FormatHexNumber -

func GetSCCode added in v0.0.5

func GetSCCode(fileName string) string

GetSCCode -

func RequireAlmostEquals added in v1.1.1

func RequireAlmostEquals(t *testing.T, expected Balance, actual Balance)

RequireAlmostEquals -

Types

type Balance added in v1.1.1

type Balance struct {
	Value *big.Int
}

Balance -

func NewBalance added in v1.1.1

func NewBalance(n int) Balance

NewBalance -

func NewBalanceBig added in v1.1.1

func NewBalanceBig(bi *big.Int) Balance

NewBalanceBig -

func (Balance) Times added in v1.1.1

func (b Balance) Times(n int) Balance

Times -

func (Balance) ToHex added in v1.1.1

func (b Balance) ToHex() string

ToHex -

type RewardsProcessor added in v1.1.1

type RewardsProcessor interface {
	ProcessRewardTransaction(rTx *rewardTx.RewardTx) error
}

RewardsProcessor -

type TestContext

type TestContext struct {
	T *testing.T

	Round uint64

	Owner        testParticipant
	Alice        testParticipant
	Bob          testParticipant
	Carol        testParticipant
	Participants []*testParticipant

	GasLimit    uint64
	GasSchedule map[string]map[string]uint64

	UnsignexTxHandler process.TransactionFeeHandler
	EconomicsFee      process.FeeHandler
	LastConsumedFee   uint64

	ScAddress        []byte
	ScCodeMetadata   vmcommon.CodeMetadata
	Accounts         *state.AccountsDB
	TxProcessor      process.TransactionProcessor
	ScProcessor      *smartContract.TestScProcessor
	QueryService     external.SCQueryService
	VMContainer      process.VirtualMachinesContainer
	BlockchainHook   *hooks.BlockChainHookImpl
	RewardsProcessor RewardsProcessor

	LastTxHash    []byte
	SCRForwarder  *mock.IntermediateTransactionHandlerMock
	LastSCResults []*smartContractResult.SmartContractResult
}

TestContext -

func SetupTestContext

func SetupTestContext(t *testing.T) *TestContext

SetupTestContext -

func (*TestContext) Close added in v0.0.5

func (context *TestContext) Close()

Close closes the test context

func (*TestContext) DeploySC

func (context *TestContext) DeploySC(wasmPath string, parametersString string) error

DeploySC -

func (*TestContext) ExecuteSC

func (context *TestContext) ExecuteSC(sender *testParticipant, txData string) error

ExecuteSC -

func (*TestContext) ExecuteSCWithValue added in v1.1.1

func (context *TestContext) ExecuteSCWithValue(sender *testParticipant, txData string, value *big.Int) error

ExecuteSCWithValue -

func (*TestContext) GetAccountBalance added in v1.1.1

func (context *TestContext) GetAccountBalance(participant *testParticipant) *big.Int

GetAccountBalance -

func (*TestContext) GetAccountBalanceDelta added in v1.1.1

func (context *TestContext) GetAccountBalanceDelta(participant *testParticipant) *big.Int

GetAccountBalanceDelta -

func (*TestContext) GetLatestError added in v1.0.103

func (context *TestContext) GetLatestError() error

GetLatestError -

func (*TestContext) GoToEpoch added in v1.1.1

func (context *TestContext) GoToEpoch(epoch int)

GoToEpoch -

func (*TestContext) InitAdditionalParticipants added in v1.1.1

func (context *TestContext) InitAdditionalParticipants(num int)

InitAdditionalParticipants -

func (*TestContext) QuerySCBigInt added in v1.1.1

func (context *TestContext) QuerySCBigInt(function string, args [][]byte) *big.Int

QuerySCBigInt -

func (*TestContext) QuerySCBytes added in v1.0.103

func (context *TestContext) QuerySCBytes(function string, args [][]byte) []byte

QuerySCBytes -

func (*TestContext) QuerySCInt

func (context *TestContext) QuerySCInt(function string, args [][]byte) uint64

QuerySCInt -

func (*TestContext) QuerySCString added in v1.0.103

func (context *TestContext) QuerySCString(function string, args [][]byte) string

QuerySCString -

func (*TestContext) TakeAccountBalanceSnapshot added in v1.1.1

func (context *TestContext) TakeAccountBalanceSnapshot(participant *testParticipant)

TakeAccountBalanceSnapshot -

func (*TestContext) UpdateLastSCResults added in v1.1.1

func (context *TestContext) UpdateLastSCResults() error

UpdateLastSCResults --

func (*TestContext) UpgradeSC added in v1.0.103

func (context *TestContext) UpgradeSC(wasmPath string, parametersString string) error

UpgradeSC -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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