Documentation ¶
Index ¶
- Constants
- Variables
- type CoreTestExecutor
- func (ae *CoreTestExecutor) ExecuteScenario(scenario *mj.Scenario, fileResolver fr.FileResolver) error
- func (ae *CoreTestExecutor) ExecuteStep(generalStep mj.Step) error
- func (ae *CoreTestExecutor) ExecuteTest(test *mj.Test) error
- func (ae *CoreTestExecutor) ExecuteTxStep(txStep *mj.TxStep) (*vmi.VMOutput, error)
- func (ae *CoreTestExecutor) GetVM() vmi.VMExecutionHandler
- func (ae *CoreTestExecutor) Reset()
Constants ¶
const DharitriProtectedKeyPrefix = "DHARITRI"
DharitriProtectedKeyPrefix prefixes all Dharitri reserved storage. Only the protocol can write to keys starting with this.
const DharitriRewardKey = DharitriProtectedKeyPrefix + "reward"
DharitriRewardKey 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 CoreTestExecutor ¶
type CoreTestExecutor struct { World *worldhook.BlockchainHookMock // contains filtered or unexported fields }
CoreTestExecutor parses, interprets and executes both .test.json tests and .scen.json scenarios with Core.
func NewCoreTestExecutor ¶
func NewCoreTestExecutor() (*CoreTestExecutor, error)
NewCoreTestExecutor prepares a new CoreTestExecutor instance.
func (*CoreTestExecutor) ExecuteScenario ¶
func (ae *CoreTestExecutor) ExecuteScenario(scenario *mj.Scenario, fileResolver fr.FileResolver) error
ExecuteScenario executes an individual test.
func (*CoreTestExecutor) ExecuteStep ¶
func (ae *CoreTestExecutor) ExecuteStep(generalStep mj.Step) error
ExecuteStep executes a single scenario step and updates mock state.
func (*CoreTestExecutor) ExecuteTest ¶
func (ae *CoreTestExecutor) ExecuteTest(test *mj.Test) error
ExecuteTest executes an individual test.
func (*CoreTestExecutor) ExecuteTxStep ¶
ExecuteTxStep executes a tx step and updates mock state.
func (*CoreTestExecutor) GetVM ¶
func (ae *CoreTestExecutor) GetVM() vmi.VMExecutionHandler
GetVM yields a reference to the VMExecutionHandler used.
func (*CoreTestExecutor) Reset ¶
func (ae *CoreTestExecutor) Reset()
Reset clears state/world. Is called in RunAllJSONScenariosInDirectory, but not in RunSingleJSONScenario.