Documentation ¶
Index ¶
- Constants
- Variables
- type VMTestExecutor
- func (ae *VMTestExecutor) Close()
- func (ae *VMTestExecutor) DumpWorld() error
- func (ae *VMTestExecutor) ExecuteCheckStateStep(step *mj.CheckStateStep) error
- func (ae *VMTestExecutor) ExecuteExternalStep(step *mj.ExternalStepsStep) 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) InitVM(scenGasSchedule mj.GasSchedule) error
- func (ae *VMTestExecutor) PeekTraceGas() bool
- func (ae *VMTestExecutor) PutNewAccount(scenAccount *mj.Account) error
- func (ae *VMTestExecutor) Reset()
- func (ae *VMTestExecutor) RunScenario(scenario *mj.Scenario, fileResolver fr.FileResolver) error
- func (ae *VMTestExecutor) UpdateAccount(scenAccount *mj.Account) 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 ¶
type VMTestExecutor struct { World *worldhook.MockWorld OverrideVMExecutor executor.ExecutorAbstractFactory // 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) 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) 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 returns the last position from the scenarioTraceGas, if existing
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) RunScenario ¶
func (ae *VMTestExecutor) RunScenario(scenario *mj.Scenario, fileResolver fr.FileResolver) error
RunScenario executes an individual test.
func (*VMTestExecutor) UpdateAccount ¶
func (ae *VMTestExecutor) UpdateAccount(scenAccount *mj.Account) error
UpdateAccount Updates an account in world account map.