Documentation ¶
Index ¶
- Constants
- Variables
- type VMTestExecutor
- func (ae *VMTestExecutor) DumpWorld() error
- func (ae *VMTestExecutor) ExecuteCheckStateStep(step *mj.CheckStateStep) error
- func (ae *VMTestExecutor) ExecuteExternalStep(step *mj.ExternalStepsStep) error
- func (ae *VMTestExecutor) ExecuteScenario(scenario *mj.Scenario, fileResolver fr.FileResolver) error
- func (ae *VMTestExecutor) ExecuteSetStateStep(step *mj.SetStateStep) error
- func (ae *VMTestExecutor) ExecuteStep(generalStep mj.Step) error
- func (ae *VMTestExecutor) ExecuteTest(test *mj.Test) error
- func (ae *VMTestExecutor) ExecuteTxStep(step *mj.TxStep) (*vmi.VMOutput, error)
- func (ae *VMTestExecutor) GetVM() vmi.VMExecutionHandler
- func (ae *VMTestExecutor) Reset()
- func (ae *VMTestExecutor) SetScenariosGasSchedule(newGasSchedule mj.GasSchedule) error
Constants ¶
const RewardKey = core.ProtectedKeyPrefix + "reward"
RewardKey is the storage key where the protocol writes when sending out rewards.
Variables ¶
var TestVMType = []byte{0, 0}
TestVMType is the VM type argument we use in tests.
Functions ¶
This section is empty.
Types ¶
type VMTestExecutor ¶
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 ¶
ExecuteTxStep executes a TxStep.
func (*VMTestExecutor) GetVM ¶
func (ae *VMTestExecutor) GetVM() vmi.VMExecutionHandler
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