utilstest

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: GPL-3.0, LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestValidatorState

func NewTestValidatorState() *validatorstest.State

func PointerTo

func PointerTo[T any](x T) *T

func SleepWithContext

func SleepWithContext(ctx context.Context, d time.Duration)

func WaitErrWithTimeout

func WaitErrWithTimeout(t *testing.T, ch <-chan error, timeout time.Duration) error

WaitErrWithTimeout waits to receive an error from ch or fails on timeout.

func WaitGroupWithContext

func WaitGroupWithContext(t *testing.T, ctx context.Context, wg *sync.WaitGroup)

func WaitGroupWithTimeout

func WaitGroupWithTimeout(t *testing.T, wg *sync.WaitGroup, timeout time.Duration, msg string)

WaitGroupWithTimeout waits for wg with timeout, failing the test with msg on timeout.

func WaitSignalWithTimeout

func WaitSignalWithTimeout(t *testing.T, ch <-chan struct{}, timeout time.Duration, msg string)

WaitSignalWithTimeout waits for a signal from ch or fails on timeout with msg.

Types

type Key

type Key struct {
	Address    common.Address
	PrivateKey *ecdsa.PrivateKey
}

Key contains an ecdsa private key field as well as an address field obtained from converting the ecdsa public key.

func NewKey

func NewKey(t *testing.T) *Key

NewKey generates a new key pair and returns a pointer to a Key.

Jump to

Keyboard shortcuts

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