Help us shape the future of Go! Take the 2026 Go Developer Survey

testutil

package
v1.20.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: GPL-3.0, LGPL-3.0, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package testutil provides testing utilities for trie operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTestKeys added in v1.2.6

func GenerateTestKeys(count int) [][]byte

GenerateTestKeys generates a set of test keys

func GenerateTestValues added in v1.2.6

func GenerateTestValues(count int) [][]byte

GenerateTestValues generates a set of test values

func InsertTestData added in v1.2.6

func InsertTestData(t *testing.T, tr *trie.Trie, keys, values [][]byte)

InsertTestData inserts test data into a trie

func NewTestTrie added in v1.2.6

func NewTestTrie(t *testing.T) (*trie.Trie, *triedb.Database)

NewTestTrie creates a new trie for testing

func RandBytes

func RandBytes(n int) []byte

RandBytes is an alias for RandomData for backward compatibility

func RandomAddress

func RandomAddress() common.Address

RandomAddress generates a random address for testing

func RandomData added in v1.2.6

func RandomData(size int) []byte

RandomData generates random data for testing

func RandomHash

func RandomHash() common.Hash

RandomHash generates a random hash for testing

func VerifyTestData added in v1.2.6

func VerifyTestData(t *testing.T, tr *trie.Trie, keys, values [][]byte)

VerifyTestData verifies test data in a trie

Types

type TestNode added in v1.16.51

type TestNode struct {
	Hash common.Hash
	Blob []byte
}

TestNode is a simple wrapper around a hash and blob for testing purposes

func RandomNode

func RandomNode() *TestNode

RandomNode generates a random node for testing

Jump to

Keyboard shortcuts

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