testutils

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWaitTimeout = 30 * time.Second

DefaultWaitTimeout is the default wait timeout. If you have a *testing.T, use WaitTimeout instead.

Variables

View Source
var FixtureChainID = big.NewInt(0)

FixtureChainID matches the chain always added by fixtures.sql It is set to 0 since no real chain ever has this ID and allows a virtual "test" chain ID to be used without clashes

Functions

func Context

func Context(t *testing.T) (ctx context.Context)

Context returns a context with the test's deadline, if available.

func NewAddress

func NewAddress() common.Address

NewAddress return a random new address

func Random32Byte

func Random32Byte() (b [32]byte)

Random32Byte returns a random [32]byte

func WaitTimeout

func WaitTimeout(t *testing.T) time.Duration

WaitTimeout returns a timeout based on the test's Deadline, if available. Especially important to use in parallel tests, as their individual execution can get paused for arbitrary amounts of time.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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