scenarioexec

package
v1.3.69 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const RewardKey = core.ProtectedKeyPrefix + "reward"

RewardKey is the storage key where the protocol writes when sending out rewards.

Variables

View Source
var TestVMType = []byte{0, 0}

TestVMType is the VM type argument we use in tests.

Functions

This section is empty.

Types

type VMTestExecutor

type VMTestExecutor struct {
	World *worldhook.MockWorld
	// contains filtered or unexported fields
}

VMTestExecutor parses, interprets and executes both .test.json tests and .scen.json scenarios with VM.

func NewVMTestExecutor

func NewVMTestExecutor() (*VMTestExecutor, error)

NewVMTestExecutor prepares a new VMTestExecutor instance.

func (*VMTestExecutor) DumpWorld

func (ae *VMTestExecutor) DumpWorld() error

DumpWorld prints the state of the MockWorld to stdout.

func (*VMTestExecutor) ExecuteCheckStateStep

func (ae *VMTestExecutor) ExecuteCheckStateStep(step *mj.CheckStateStep) error

ExecuteCheckStateStep executes a CheckStateStep defined by the current scenario.

func (*VMTestExecutor) ExecuteExternalStep

func (ae *VMTestExecutor) ExecuteExternalStep(step *mj.ExternalStepsStep) error

ExecuteExternalStep executes an external step referenced by the scenario.

func (*VMTestExecutor) ExecuteScenario

func (ae *VMTestExecutor) ExecuteScenario(scenario *mj.Scenario, fileResolver fr.FileResolver) error

ExecuteScenario executes an individual test.

func (*VMTestExecutor) ExecuteSetStateStep

func (ae *VMTestExecutor) ExecuteSetStateStep(step *mj.SetStateStep) error

ExecuteSetStateStep executes a SetStateStep.

func (*VMTestExecutor) ExecuteStep

func (ae *VMTestExecutor) ExecuteStep(generalStep mj.Step) error

ExecuteStep executes an individual step from a scenario.

func (*VMTestExecutor) ExecuteTest

func (ae *VMTestExecutor) ExecuteTest(test *mj.Test) error

ExecuteTest executes an individual test.

func (*VMTestExecutor) ExecuteTxStep

func (ae *VMTestExecutor) ExecuteTxStep(step *mj.TxStep) (*vmi.VMOutput, error)

ExecuteTxStep executes a TxStep.

func (*VMTestExecutor) GetVM

GetVM yields a reference to the VMExecutionHandler used.

func (*VMTestExecutor) Reset

func (ae *VMTestExecutor) Reset()

Reset clears state/world. Is called in RunAllJSONScenariosInDirectory, but not in RunSingleJSONScenario.

func (*VMTestExecutor) SetScenariosGasSchedule

func (ae *VMTestExecutor) SetScenariosGasSchedule(newGasSchedule mj.GasSchedule) error

SetScenariosGasSchedule updates the gas costs based on the scenario config only changes the gas schedule once, this prevents subsequent gasSchedule declarations in externalSteps to overwrite

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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