tests

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Contains resources or utils for test units

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateWakuMessage

func CreateWakuMessage(contentTopic string, timestamp int64) *pb.WakuMessage

CreateWakuMessage creates a WakuMessage protobuffer with default values and a custom contenttopic and timestamp

func FindFreePort

func FindFreePort(t *testing.T, host string, maxAttempts int) (int, error)

FindFreePort returns an available port number

func GetHostAddress

func GetHostAddress(ha host.Host) ma.Multiaddr

GetHostAddress returns the first listen address used by a host

func MakeHost

func MakeHost(ctx context.Context, port int, randomness io.Reader) (host.Host, error)

MakeHost creates a Libp2p host with a random key on a specific port

func RandomHex

func RandomHex(n int) (string, error)

RandomHex returns a random hex string of n bytes

Types

This section is empty.

Jump to

Keyboard shortcuts

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