arwenmandos

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2022 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const ElrondProtectedKeyPrefix = "ELROND"

ElrondProtectedKeyPrefix prefixes all Elrond reserved storage. Only the protocol can write to keys starting with this.

View Source
const ElrondRewardKey = ElrondProtectedKeyPrefix + "reward"

ElrondRewardKey is the storage key where the protocol writes when sending out rewards.

Variables

View Source
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

func (ae *ArwenTestExecutor) ExecuteTxStep(step *mj.TxStep) (*vmi.VMOutput, error)

ExecuteTxStep executes a TxStep.

func (*ArwenTestExecutor) GetVM

GetVM yields a reference to the VMExecutionHandler used.

func (*ArwenTestExecutor) GetVMHost

func (ae *ArwenTestExecutor) GetVMHost() arwen.VMHost

GetVMHost returns de vm Context from the vm context map

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

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL