test_utils

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConditionLogFunctionType = sema.NewSimpleFunctionType(
	sema.FunctionPurityView,
	[]sema.Parameter{
		{
			Label:          sema.ArgumentLabelNotRequired,
			Identifier:     "value",
			TypeAnnotation: sema.AnyStructTypeAnnotation,
		},
	},
	sema.BoolTypeAnnotation,
)

Functions

func ParseCheckAndInterpret added in v1.5.0

func ParseCheckAndInterpret(t testing.TB, code string) *interpreter.Interpreter

func ParseCheckAndInterpretWithAtreeValidationsDisabled added in v1.5.0

func ParseCheckAndInterpretWithAtreeValidationsDisabled(
	t testing.TB,
	code string,
	options ParseCheckAndInterpretOptions,
) (
	inter *interpreter.Interpreter,
	err error,
)

func ParseCheckAndInterpretWithOptions added in v1.5.0

func ParseCheckAndInterpretWithOptions(
	t testing.TB,
	code string,
	options ParseCheckAndInterpretOptions,
) (
	inter *interpreter.Interpreter,
	err error,
)

func ParseCheckAndPrepare

func ParseCheckAndPrepare(tb testing.TB, code string, compile bool) Invokable

func ParseCheckAndPrepareWithAtreeValidationsDisabled added in v1.7.0

func ParseCheckAndPrepareWithAtreeValidationsDisabled(
	tb testing.TB,
	code string,
	options ParseCheckAndInterpretOptions,
	compile bool,
) (Invokable, error)

func ParseCheckAndPrepareWithEvents added in v1.5.0

func ParseCheckAndPrepareWithEvents(tb testing.TB, code string, compile bool) (
	invokable Invokable,
	getEvents func() []TestEvent,
	err error,
)

func ParseCheckAndPrepareWithLogs added in v1.7.0

func ParseCheckAndPrepareWithLogs(
	tb testing.TB,
	code string,
	compile bool,
) (
	invokable Invokable,
	getLogs func() []string,
	err error,
)

func ParseCheckAndPrepareWithOptions added in v1.5.0

func ParseCheckAndPrepareWithOptions(
	tb testing.TB,
	code string,
	options ParseCheckAndInterpretOptions,
	compile bool,
	compare bool,
) (
	invokable Invokable,
	err error,
)

func ParseCheckAndPrepareWithoutStorageComparison added in v1.9.0

func ParseCheckAndPrepareWithoutStorageComparison(tb testing.TB, code string, compile bool) Invokable

Types

type ParseCheckAndInterpretOptions

type ParseCheckAndInterpretOptions struct {
	ParseAndCheckOptions *ParseAndCheckOptions
	InterpreterConfig    *interpreter.Config
	HandleCheckerError   func(error)
}

type TestEvent added in v1.5.0

type TestEvent struct {
	EventType   *sema.CompositeType
	EventFields []interpreter.Value
}

type VMInvokable added in v1.7.0

type VMInvokable struct {
	*vm.Context
	// contains filtered or unexported fields
}

func NewVMInvokable added in v1.7.0

func NewVMInvokable(
	vmInstance *vm.VM,
	elaboration *compiler.DesugaredElaboration,
) *VMInvokable

func (*VMInvokable) GetGlobal added in v1.7.0

func (v *VMInvokable) GetGlobal(name string) interpreter.Value

func (*VMInvokable) GetGlobalType added in v1.7.0

func (v *VMInvokable) GetGlobalType(name string) (*sema.Variable, bool)

func (*VMInvokable) InitializeContract added in v1.7.0

func (v *VMInvokable) InitializeContract(contractName string, arguments ...interpreter.Value) (*interpreter.CompositeValue, error)

func (*VMInvokable) Invoke added in v1.7.0

func (v *VMInvokable) Invoke(functionName string, arguments ...interpreter.Value) (value interpreter.Value, vmError error)

func (*VMInvokable) InvokeTransaction added in v1.7.0

func (v *VMInvokable) InvokeTransaction(arguments []interpreter.Value, signers ...interpreter.Value) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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