test

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Overview

Package test contains implementations of the peer interfaces that are useful for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenericBusTest

func GenericBusTest(t *testing.T, busAssigner func(wire.Account) wire.Bus, numClients, numMsgs int)

GenericBusTest tests the general functionality of a bus in the happy case: it tests that messages sent over the bus arrive at the correct destination. The parameter numClients controls how many clients communicate over the bus, and numMsgs controls how many messages each client sends to all other clients. The parameter busAssigner is used to assign a bus to each client, and must perform any necessary work to make clients able to communicate with each other (such as setting up dialers and listeners, in case of networking).

func NewRandomAddress

func NewRandomAddress(rng *rand.Rand) wire.Address

NewRandomAddress returns a new random peer address. Currently still a stub until the crypto for peer addresses is decided.

func NewRandomAddresses

func NewRandomAddresses(rng *rand.Rand, n int) []wire.Address

NewRandomAddresses returns a slice of random peer addresses.

func NewRandomEnvelope

func NewRandomEnvelope(rng *rand.Rand, m wire.Msg) *wire.Envelope

NewRandomEnvelope returns an envelope around message m with random sender and recipient generated using randomness from rng.

Types

This section is empty.

Jump to

Keyboard shortcuts

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