Documentation ¶
Index ¶
- Constants
- Variables
- type ArwenTestExecutor
- func (ae *ArwenTestExecutor) Close()
- func (ae *ArwenTestExecutor) DumpWorld() error
- func (ae *ArwenTestExecutor) ExecuteCheckStateStep(step *mj.CheckStateStep) error
- func (ae *ArwenTestExecutor) ExecuteExternalStep(step *mj.ExternalStepsStep) error
- func (ae *ArwenTestExecutor) ExecuteScenario(scenario *mj.Scenario, fileResolver fr.FileResolver) error
- func (ae *ArwenTestExecutor) ExecuteSetStateStep(step *mj.SetStateStep) error
- func (ae *ArwenTestExecutor) ExecuteStep(generalStep mj.Step) error
- func (ae *ArwenTestExecutor) ExecuteTest(test *mj.Test) error
- func (ae *ArwenTestExecutor) ExecuteTxStep(step *mj.TxStep) (*vmi.VMOutput, error)
- func (ae *ArwenTestExecutor) GetVM() vmi.VMExecutionHandler
- func (ae *ArwenTestExecutor) GetVMHost() arwen.VMHost
- func (ae *ArwenTestExecutor) InitVM(mandosGasSchedule mj.GasSchedule) error
- func (ae *ArwenTestExecutor) PeekTraceGas() bool
- func (ae *ArwenTestExecutor) PutNewAccount(mandosAccount *mj.Account) error
- func (ae *ArwenTestExecutor) Reset()
- func (ae *ArwenTestExecutor) UpdateAccount(mandosAccount *mj.Account) error
Constants ¶
const ElrondProtectedKeyPrefix = "ELROND"
ElrondProtectedKeyPrefix prefixes all Elrond reserved storage. Only the protocol can write to keys starting with this.
const ElrondRewardKey = ElrondProtectedKeyPrefix + "reward"
ElrondRewardKey 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 ArwenTestExecutor ¶
type ArwenTestExecutor struct { World *worldhook.MockWorld // contains filtered or unexported fields }
ArwenTestExecutor parses, interprets and executes both .test.json tests and .scen.json scenarios with Arwen.
func NewArwenTestExecutor ¶
func NewArwenTestExecutor() (*ArwenTestExecutor, error)
NewArwenTestExecutor prepares a new ArwenTestExecutor instance.
func (*ArwenTestExecutor) Close ¶
func (ae *ArwenTestExecutor) Close()
Close will simply close the VM
func (*ArwenTestExecutor) DumpWorld ¶
func (ae *ArwenTestExecutor) DumpWorld() error
DumpWorld prints the state of the MockWorld to stdout.
func (*ArwenTestExecutor) ExecuteCheckStateStep ¶
func (ae *ArwenTestExecutor) ExecuteCheckStateStep(step *mj.CheckStateStep) error
ExecuteCheckStateStep executes a CheckStateStep defined by the current scenario.
func (*ArwenTestExecutor) ExecuteExternalStep ¶
func (ae *ArwenTestExecutor) ExecuteExternalStep(step *mj.ExternalStepsStep) error
ExecuteExternalStep executes an external step referenced by the scenario.
func (*ArwenTestExecutor) ExecuteScenario ¶
func (ae *ArwenTestExecutor) ExecuteScenario(scenario *mj.Scenario, fileResolver fr.FileResolver) error
ExecuteScenario executes an individual test.
func (*ArwenTestExecutor) ExecuteSetStateStep ¶
func (ae *ArwenTestExecutor) ExecuteSetStateStep(step *mj.SetStateStep) error
ExecuteSetStateStep executes a SetStateStep.
func (*ArwenTestExecutor) ExecuteStep ¶
func (ae *ArwenTestExecutor) ExecuteStep(generalStep mj.Step) error
ExecuteStep executes an individual step from a scenario.
func (*ArwenTestExecutor) ExecuteTest ¶
func (ae *ArwenTestExecutor) ExecuteTest(test *mj.Test) error
ExecuteTest executes an individual test.
func (*ArwenTestExecutor) ExecuteTxStep ¶
ExecuteTxStep executes a TxStep.
func (*ArwenTestExecutor) GetVM ¶
func (ae *ArwenTestExecutor) GetVM() vmi.VMExecutionHandler
GetVM yields a reference to the VMExecutionHandler used.
func (*ArwenTestExecutor) GetVMHost ¶
func (ae *ArwenTestExecutor) GetVMHost() arwen.VMHost
GetVMHost returns the VM host instance in the test executor.
func (*ArwenTestExecutor) InitVM ¶
func (ae *ArwenTestExecutor) InitVM(mandosGasSchedule mj.GasSchedule) error
InitVM will initialize the VM and the builtin function container. Does nothing if the VM is already initialized.
func (*ArwenTestExecutor) PeekTraceGas ¶
func (ae *ArwenTestExecutor) PeekTraceGas() bool
PeekTraceGas -
func (*ArwenTestExecutor) PutNewAccount ¶
func (ae *ArwenTestExecutor) PutNewAccount(mandosAccount *mj.Account) error
PutNewAccount Puts a new account in world account map. Overwrites.
func (*ArwenTestExecutor) Reset ¶
func (ae *ArwenTestExecutor) Reset()
Reset clears state/world. Is called in RunAllJSONScenariosInDirectory, but not in RunSingleJSONScenario.
func (*ArwenTestExecutor) UpdateAccount ¶
func (ae *ArwenTestExecutor) UpdateAccount(mandosAccount *mj.Account) error
UpdateAccount Updates an account in world account map.