scenarioexec

package
v1.4.88 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: GPL-3.0 Imports: 28 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) Close

func (ae *VMTestExecutor) Close()

Close will simply close the VM

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

func (ae *VMTestExecutor) GetVMHost() vmhost.VMHost

GetVMHost returns the VM host instance in the test executor.

func (*VMTestExecutor) InitVM

func (ae *VMTestExecutor) InitVM(scenGasSchedule mj.GasSchedule) error

InitVM will initialize the VM and the builtin function container. Does nothing if the VM is already initialized.

func (*VMTestExecutor) PeekTraceGas

func (ae *VMTestExecutor) PeekTraceGas() bool

PeekTraceGas -

func (*VMTestExecutor) PutNewAccount

func (ae *VMTestExecutor) PutNewAccount(scenAccount *mj.Account) error

PutNewAccount Puts a new account in world account map. Overwrites.

func (*VMTestExecutor) Reset

func (ae *VMTestExecutor) Reset()

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

func (*VMTestExecutor) UpdateAccount

func (ae *VMTestExecutor) UpdateAccount(scenAccount *mj.Account) error

UpdateAccount Updates an account in world account map.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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