core

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DummyCodeMetadataHex = "0102"

DummyCodeMetadataHex -

View Source
const VMTypeHex = "0500"

VMTypeHex -

Variables

This section is empty.

Functions

func CreateDeployTxData

func CreateDeployTxData(scCode string) string

CreateDeployTxData -

func FormatHexNumber

func FormatHexNumber(number uint64) string

FormatHexNumber -

func GetSCCode

func GetSCCode(fileName string) string

GetSCCode -

Types

type TestContext

type TestContext struct {
	T *testing.T

	Round uint64

	Owner testParticipant
	Alice testParticipant
	Bob   testParticipant
	Carol testParticipant

	GasLimit uint64

	ScAddress      []byte
	ScCodeMetadata vmcommon.CodeMetadata
	Accounts       *state.AccountsDB
	TxProcessor    process.TransactionProcessor
	ScProcessor    process.SmartContractProcessor
	QueryService   external.SCQueryService
	VMContainer    process.VirtualMachinesContainer
}

TestContext -

func SetupTestContext

func SetupTestContext(t *testing.T) TestContext

SetupTestContext -

func (*TestContext) Close

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) GetLatestError

func (context *TestContext) GetLatestError() error

GetLatestError -

func (*TestContext) QuerySCBytes

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

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

QuerySCString -

func (*TestContext) UpgradeSC

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

UpgradeSC -

Jump to

Keyboard shortcuts

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