testutils

package
v0.15.13 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdjacentNodes

type AdjacentNodes []map[int]struct{}

AdjacentNodes is a slice of N sets, each representing the nodes adjacent to the node at the index.

func LineNetworkConfig

func LineNetworkConfig(n int) AdjacentNodes

func NewAdjacentNodes

func NewAdjacentNodes(n int) AdjacentNodes

NewAdjacentNodes creates a new AdjacentNodes with N nodes with initially no connections.

func SmallWorldNetworkConfig

func SmallWorldNetworkConfig(n int) AdjacentNodes

func (AdjacentNodes) Connect

func (a AdjacentNodes) Connect(from, to int)

func (AdjacentNodes) ConnectRandomDirection

func (a AdjacentNodes) ConnectRandomDirection(from, to int) bool

type NetworkConfigFn

type NetworkConfigFn func(int) AdjacentNodes

NetworkConfigFn is a function that returns an AdjacentNodes for a given number of nodes.

type Node

type Node struct {
	Host              host.Host
	GetBootstrapPeers func() []peer.AddrInfo
}

type Nodes

type Nodes []Node

func BuildNetworks

func BuildNetworks(
	t *testing.T,
	adjacentNodes AdjacentNodes,
) Nodes

func (Nodes) JoinTopic

func (n Nodes) JoinTopic(t *testing.T, chainID, protocolID protocol.ID, topicName string) []*libp2p.Topic

Jump to

Keyboard shortcuts

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