utilstest

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: GPL-3.0, LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestContext added in v0.15.4

func NewTestContext(t *testing.T) (context.Context, context.CancelFunc)

func PointerTo added in v0.15.4

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

func SleepWithContext added in v0.15.4

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

func WaitErrWithTimeout added in v0.15.4

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 added in v0.15.4

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

func WaitGroupWithTimeout added in v0.15.4

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 added in v0.15.4

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