Documentation ¶
Index ¶
- type DummyVM
- func (*DummyVM) Close() error
- func (*DummyVM) GasScheduleChange(newGasSchedule map[string]map[string]uint64)
- func (*DummyVM) GetGasTrace() map[string]map[string][]uint64
- func (*DummyVM) GetVersion() string
- func (*DummyVM) IsInterfaceNil() bool
- func (*DummyVM) Reset()
- func (*DummyVM) RunSmartContractCall(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
- func (*DummyVM) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)
- func (*DummyVM) SetGasTracing(enableGasTracing bool)
- type DummyVMBuilder
- func (*DummyVMBuilder) GasScheduleMapFromScenarios(scenGasSchedule scenmodel.GasSchedule) (worldmock.GasScheduleMap, error)
- func (*DummyVMBuilder) GetVMType() []byte
- func (*DummyVMBuilder) NewMockWorld() *worldmock.MockWorld
- func (*DummyVMBuilder) NewVM(world *worldmock.MockWorld, gasSchedule map[string]map[string]uint64) (scenarioexec.VMInterface, error)
- type ScenariosTestBuilder
- func (mtb *ScenariosTestBuilder) CheckNoError() *ScenariosTestBuilder
- func (mtb *ScenariosTestBuilder) Exclude(path string) *ScenariosTestBuilder
- func (mtb *ScenariosTestBuilder) File(fileName string) *ScenariosTestBuilder
- func (mtb *ScenariosTestBuilder) Folder(folder string) *ScenariosTestBuilder
- func (mtb *ScenariosTestBuilder) RequireError(expectedErrorMsg string) *ScenariosTestBuilder
- func (mtb *ScenariosTestBuilder) Run() *ScenariosTestBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DummyVM ¶
type DummyVM struct{}
DummyVM is a VM stand-in that can never be called. Used for tests that do not require a VM.
func (*DummyVM) GasScheduleChange ¶
GasScheduleChange -
func (*DummyVM) GetGasTrace ¶
GetGasTrace -
func (*DummyVM) RunSmartContractCall ¶
RunSmartContractCall -
func (*DummyVM) RunSmartContractCreate ¶
func (*DummyVM) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)
RunSmartContractCreate -
func (*DummyVM) SetGasTracing ¶
SetGasTracing -
type DummyVMBuilder ¶
type DummyVMBuilder struct{}
DummyVMBuilder is the builder for a DummyVM. Also provides a minimal gas schedule for running the builtin functions. Used for tests that do not require a VM.
func (*DummyVMBuilder) GasScheduleMapFromScenarios ¶
func (*DummyVMBuilder) GasScheduleMapFromScenarios(scenGasSchedule scenmodel.GasSchedule) (worldmock.GasScheduleMap, error)
GasScheduleMapFromScenarios converts the gas schedule name from a scenario into an actual gas map.
func (*DummyVMBuilder) GetVMType ¶
func (*DummyVMBuilder) GetVMType() []byte
GetVMType returns the configured VM type.
func (*DummyVMBuilder) NewMockWorld ¶
func (*DummyVMBuilder) NewMockWorld() *worldmock.MockWorld
NewMockWorld defines how the MockWorld is initialized.
func (*DummyVMBuilder) NewVM ¶
func (*DummyVMBuilder) NewVM(world *worldmock.MockWorld, gasSchedule map[string]map[string]uint64) (scenarioexec.VMInterface, error)
NewVM creates the execution VM host with references to the world mock and gas schedule.
type ScenariosTestBuilder ¶
type ScenariosTestBuilder struct {
// contains filtered or unexported fields
}
ScenariosTestBuilder defines the Scenarios builder component
func ScenariosTest ¶
func ScenariosTest(t *testing.T) *ScenariosTestBuilder
ScenariosTest will create a new ScenariosTestBuilder instance
func (*ScenariosTestBuilder) CheckNoError ¶
func (mtb *ScenariosTestBuilder) CheckNoError() *ScenariosTestBuilder
CheckNoError does an assert for the containing error
func (*ScenariosTestBuilder) Exclude ¶
func (mtb *ScenariosTestBuilder) Exclude(path string) *ScenariosTestBuilder
Exclude sets the exclusion path
func (*ScenariosTestBuilder) File ¶
func (mtb *ScenariosTestBuilder) File(fileName string) *ScenariosTestBuilder
File sets the file
func (*ScenariosTestBuilder) Folder ¶
func (mtb *ScenariosTestBuilder) Folder(folder string) *ScenariosTestBuilder
Folder sets the folder
func (*ScenariosTestBuilder) RequireError ¶
func (mtb *ScenariosTestBuilder) RequireError(expectedErrorMsg string) *ScenariosTestBuilder
RequireError does an assert for the containing error
func (*ScenariosTestBuilder) Run ¶
func (mtb *ScenariosTestBuilder) Run() *ScenariosTestBuilder
Run will start the testing process