tests

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: GPL-3.0, LGPL-3.0 Imports: 31 Imported by: 1

Documentation

Overview

Package tests implements execution of QRL JSON tests.

Index

Constants

This section is empty.

Variables

View Source
var Forks = map[string]*params.ChainConfig{
	"Zond": {
		ChainID: big.NewInt(1),
	},
}

Forks table defines supported forks and their chain config.

Functions

func AvailableForks

func AvailableForks() []string

AvailableForks returns the set of defined fork names

func GetChainConfig

func GetChainConfig(forkString string) (baseConfig *params.ChainConfig, qips []int, err error)

GetChainConfig takes a fork definition and returns a chain config. The fork definition can be - a plain forkname, e.g. `Byzantium`, - a fork basename, and a list of QIPs to enable; e.g. `Byzantium+1884+1283`.

func MakePreState

func MakePreState(db qrldb.Database, accounts core.GenesisAlloc, snapshotter bool, scheme string) (*trie.Database, *snapshot.Tree, *state.StateDB)

Types

type BlockTest

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

A BlockTest checks handling of entire blocks.

func (*BlockTest) Run

func (t *BlockTest) Run(snapshotter bool, scheme string, tracer vm.QRVMLogger) error

func (*BlockTest) UnmarshalJSON

func (t *BlockTest) UnmarshalJSON(in []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type StateSubtest

type StateSubtest struct {
	Fork  string
	Index int
}

StateSubtest selects a specific configuration of a General State Test.

type StateTest

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

StateTest checks transaction processing without block context. See https://github.com/ethereum/EIPs/issues/176 for the test format specification.

func (*StateTest) Run

func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config, snapshotter bool, scheme string, postCheck func(err error, snaps *snapshot.Tree, state *state.StateDB)) (result error)

Run executes a specific subtest and verifies the post-state and logs

func (*StateTest) RunNoVerify

func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapshotter bool, scheme string) (*trie.Database, *snapshot.Tree, *state.StateDB, common.Hash, error)

RunNoVerify runs a specific subtest and returns the statedb and post-state root

func (*StateTest) Subtests

func (t *StateTest) Subtests() []StateSubtest

Subtests returns all valid subtests of the test.

func (*StateTest) UnmarshalJSON

func (t *StateTest) UnmarshalJSON(in []byte) error

type UnsupportedForkError

type UnsupportedForkError struct {
	Name string
}

UnsupportedForkError is returned when a test requests a fork that isn't implemented.

func (UnsupportedForkError) Error

func (e UnsupportedForkError) Error() string

Directories

Path Synopsis
fuzzers

Jump to

Keyboard shortcuts

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