evms

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareFiles

func CompareFiles(vms []Evm, readers []io.Reader) bool

func RemoveUnsupportedElems

func RemoveUnsupportedElems(elem *vm.StructLog)

RemoveUnsupportedElems removes some elements that not all clients support. Once the relenvant json-fields have been added, we can remove things from this method

Types

type AlethVM

type AlethVM struct {
	// contains filtered or unexported fields
}

AlethVM is s Evm-interface wrapper around the `testeth` binary, based on Aleth.

func NewAlethVM

func NewAlethVM(path string) *AlethVM

func (*AlethVM) Close

func (vm *AlethVM) Close()

func (*AlethVM) Copy

func (evm *AlethVM) Copy(out io.Writer, input io.Reader)

feed reads from the reader, does some geth-specific filtering and outputs items onto the channel

func (*AlethVM) GetStateRoot

func (evm *AlethVM) GetStateRoot(path string) (string, error)

GetStateRoot runs the test and returns the stateroot

func (*AlethVM) Name

func (evm *AlethVM) Name() string

func (*AlethVM) RunStateTest

func (evm *AlethVM) RunStateTest(path string, out io.Writer, speedTest bool) (string, error)

RunStateTest implements the Evm interface

type BesuBatchVM

type BesuBatchVM struct {
	// contains filtered or unexported fields
}

BesuBatchVM is s Evm-interface wrapper around the `evmtool` binary, based on Besu. The BatchVM spins up one 'master' instance of the VM, and uses that to execute tests

func NewBesuBatchVM

func NewBesuBatchVM(path string) *BesuBatchVM

func (*BesuBatchVM) Close

func (vm *BesuBatchVM) Close()

func (*BesuBatchVM) Copy

func (evm *BesuBatchVM) Copy(out io.Writer, input io.Reader)

Copy feed reads from the reader, does some client-specific filtering and outputs BesuBatchVM onto the channel

func (*BesuBatchVM) GetStateRoot

func (vm *BesuBatchVM) GetStateRoot(path string) (string, error)

func (*BesuBatchVM) Name

func (evm *BesuBatchVM) Name() string

func (*BesuBatchVM) RunStateTest

func (evm *BesuBatchVM) RunStateTest(path string, out io.Writer, speedTest bool) (string, error)

RunStateTest implements the Evm interface

type BesuVM

type BesuVM struct {
	// contains filtered or unexported fields
}

BesuVM is s Evm-interface wrapper around the `evmtool` binary, based on Besu.

func NewBesuVM

func NewBesuVM(path string) *BesuVM

func (*BesuVM) Close

func (vm *BesuVM) Close()

func (*BesuVM) Copy

func (evm *BesuVM) Copy(out io.Writer, input io.Reader)

feed reads from the reader, does some geth-specific filtering and outputs items onto the channel

func (*BesuVM) GetStateRoot

func (vm *BesuVM) GetStateRoot(path string) (string, error)

func (*BesuVM) Name

func (evm *BesuVM) Name() string

func (*BesuVM) RunStateTest

func (evm *BesuVM) RunStateTest(path string, out io.Writer, speedTest bool) (string, error)

RunStateTest implements the Evm interface

type Evm

type Evm interface {
	// RunStateTest runs the statetest on the underlying EVM, and writes
	// the output to the given writer
	RunStateTest(path string, writer io.Writer, speedTest bool) (string, error)
	// GetStateRoot runs the test and returns the stateroot
	GetStateRoot(path string) (string, error)
	// Copy takes the 'raw' output from the VM, and writes the
	// canonical output to the given writer
	Copy(out io.Writer, input io.Reader)
	//Open() // Preparare for execution
	Close() // Tear down processes
	Name() string
}

The Evm interface represents external EVM implementations, which can be e.g. docker instances or binaries

type GethEVM

type GethEVM struct {
	// contains filtered or unexported fields
}

GethEVM is s Evm-interface wrapper around the `evm` binary, based on go-ethereum.

func NewGethEVM

func NewGethEVM(path string) *GethEVM

func (*GethEVM) Close

func (vm *GethEVM) Close()

func (*GethEVM) Copy

func (evm *GethEVM) Copy(out io.Writer, input io.Reader)

feed reads from the reader, does some geth-specific filtering and outputs items onto the channel

func (*GethEVM) GetStateRoot

func (evm *GethEVM) GetStateRoot(path string) (string, error)

GetStateRoot runs the test and returns the stateroot This currently only works for non-filled statetests. TODO: make it work even if the test is filled. Either by getting the whole trace, or adding stateroot to exec std output even in success-case

func (*GethEVM) Name

func (evm *GethEVM) Name() string

func (*GethEVM) RunStateTest

func (evm *GethEVM) RunStateTest(path string, out io.Writer, speedTest bool) (string, error)

RunStateTest implements the Evm interface

type NethermindVM

type NethermindVM struct {
	// contains filtered or unexported fields
}

NethermindVM is s Evm-interface wrapper around the `nethtest` binary, based on Nethermind.

func NewNethermindVM

func NewNethermindVM(path string) *NethermindVM

func (*NethermindVM) Close

func (vm *NethermindVM) Close()

func (*NethermindVM) Copy

func (evm *NethermindVM) Copy(out io.Writer, input io.Reader)

feed reads from the reader, does some geth-specific filtering and outputs items onto the channel

func (*NethermindVM) GetStateRoot

func (evm *NethermindVM) GetStateRoot(path string) (string, error)

GetStateRoot runs the test and returns the stateroot

func (*NethermindVM) Name

func (evm *NethermindVM) Name() string

func (*NethermindVM) RunStateTest

func (evm *NethermindVM) RunStateTest(path string, out io.Writer, speedTest bool) (string, error)

RunStateTest implements the Evm interface

type ParityVM

type ParityVM struct {
	// contains filtered or unexported fields
}

func NewParityVM

func NewParityVM(path string) *ParityVM

func (*ParityVM) Close

func (evm *ParityVM) Close()

func (*ParityVM) Copy

func (evm *ParityVM) Copy(out io.Writer, input io.Reader)

func (*ParityVM) GetStateRoot

func (evm *ParityVM) GetStateRoot(path string) (string, error)

GetStateRoot runs the test and returns the stateroot

func (*ParityVM) Name

func (evm *ParityVM) Name() string

func (*ParityVM) RunStateTest

func (evm *ParityVM) RunStateTest(path string, out io.Writer, speedTest bool) (string, error)

RunStateTest implements the Evm interface

Jump to

Keyboard shortcuts

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