tests

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: GPL-3.0, LGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Forks table defines supported forks and their chain config.

Functions

func AvailableForks

func AvailableForks() []string

AvailableForks returns the set of defined fork names

func FromHex

func FromHex(s string) ([]byte, error)

FromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with "0x". This is copy-pasted from bytes.go, which does not return the error

func GetRepoRootPath

func GetRepoRootPath(suffix string) string

Types

type RLPTest

type RLPTest struct {
	// If the value of In is "INVALID" or "VALID", the test
	// checks whether Out can be decoded into a value of
	// type interface{}.
	//
	// For other JSON values, In is treated as a driver for
	// calls to rlp.Stream. The test also verifies that encoding
	// In produces the bytes in Out.
	In interface{}

	// Out is a hex-encoded RLP value.
	Out string
}

RLPTest is the JSON structure of a single RLP test.

func (*RLPTest) Run

func (t *RLPTest) Run() error

Run executes the test.

type StateTestState

type StateTestState struct {
	StateDB   *state.StateDB
	TrieDB    *triedb.Database
	Snapshots *snapshot.Tree
	TempDir   string
}

StateTestState groups all the state database objects together for use in tests.

func MakePreState

func MakePreState(db ethdb.Database, accounts types.GenesisAlloc, snapshotter bool, scheme string) StateTestState

MakePreState creates a state containing the given allocation.

func (*StateTestState) Close

func (st *StateTestState) Close()

Close should be called when the state is no longer needed, ie. after running the test.

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

Jump to

Keyboard shortcuts

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