executortest

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyVM

type DummyVM struct{}

DummyVM is a VM stand-in that can never be called. Used for tests that do not require a VM.

func (*DummyVM) Close

func (*DummyVM) Close() error

Close -

func (*DummyVM) GasScheduleChange

func (*DummyVM) GasScheduleChange(newGasSchedule map[string]map[string]uint64)

GasScheduleChange -

func (*DummyVM) GetGasTrace

func (*DummyVM) GetGasTrace() map[string]map[string][]uint64

GetGasTrace -

func (*DummyVM) GetVersion

func (*DummyVM) GetVersion() string

GetVersion -

func (*DummyVM) IsInterfaceNil

func (*DummyVM) IsInterfaceNil() bool

IsInterfaceNil -

func (*DummyVM) Reset

func (*DummyVM) Reset()

Reset -

func (*DummyVM) RunSmartContractCall

func (*DummyVM) RunSmartContractCall(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)

RunSmartContractCall -

func (*DummyVM) RunSmartContractCreate

func (*DummyVM) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)

RunSmartContractCreate -

func (*DummyVM) SetGasTracing

func (*DummyVM) SetGasTracing(enableGasTracing bool)

SetGasTracing -

type DummyVMBuilder

type DummyVMBuilder struct{}

DummyVMBuilder is the builder for a DummyVM. Also provides a minimal gas schedule for running the builtin functions. Used for tests that do not require a VM.

func (*DummyVMBuilder) GasScheduleMapFromScenarios

func (*DummyVMBuilder) GasScheduleMapFromScenarios(scenGasSchedule scenmodel.GasSchedule) (worldmock.GasScheduleMap, error)

GasScheduleMapFromScenarios converts the gas schedule name from a scenario into an actual gas map.

func (*DummyVMBuilder) GetVMType

func (*DummyVMBuilder) GetVMType() []byte

GetVMType returns the configured VM type.

func (*DummyVMBuilder) NewMockWorld

func (*DummyVMBuilder) NewMockWorld() *worldmock.MockWorld

NewMockWorld defines how the MockWorld is initialized.

func (*DummyVMBuilder) NewVM

func (*DummyVMBuilder) NewVM(world *worldmock.MockWorld, gasSchedule map[string]map[string]uint64) (scenarioexec.VMInterface, error)

NewVM creates the execution VM host with references to the world mock and gas schedule.

type ScenariosTestBuilder

type ScenariosTestBuilder struct {
	// contains filtered or unexported fields
}

ScenariosTestBuilder defines the Scenarios builder component

func ScenariosTest

func ScenariosTest(t *testing.T) *ScenariosTestBuilder

ScenariosTest will create a new ScenariosTestBuilder instance

func (*ScenariosTestBuilder) CheckNoError

func (mtb *ScenariosTestBuilder) CheckNoError() *ScenariosTestBuilder

CheckNoError does an assert for the containing error

func (*ScenariosTestBuilder) Exclude

func (mtb *ScenariosTestBuilder) Exclude(path string) *ScenariosTestBuilder

Exclude sets the exclusion path

func (*ScenariosTestBuilder) File

func (mtb *ScenariosTestBuilder) File(fileName string) *ScenariosTestBuilder

File sets the file

func (*ScenariosTestBuilder) Folder

func (mtb *ScenariosTestBuilder) Folder(folder string) *ScenariosTestBuilder

Folder sets the folder

func (*ScenariosTestBuilder) RequireError

func (mtb *ScenariosTestBuilder) RequireError(expectedErrorMsg string) *ScenariosTestBuilder

RequireError does an assert for the containing error

func (*ScenariosTestBuilder) Run

Run will start the testing process

Jump to

Keyboard shortcuts

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