test

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package test provides in-process AtomicBroadcast servers for testing the broadcast of envelopes to Fabric-X routers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreeAddress

func FreeAddress(t *testing.T) string

FreeAddress returns a "host:port" that no server is listening on, so a dial to it fails. The listener is closed before returning.

func ServeConfigDeliver

func ServeConfigDeliver(t *testing.T, lis net.Listener, ledger ConfigLedger)

ServeConfigDeliver serves the config-deliver stub for the given config ledger on lis. It lets callers bind the listener first (learning its address before building a config block that references it). The server is stopped when the test ends.

func StartBroadcastServer

func StartBroadcastServer(t *testing.T, status cb.Status) string

StartBroadcastServer starts an in-process AtomicBroadcast server that answers every broadcast with status, and returns its "host:port" address. The server is stopped when the test ends.

func StartConfigDeliverServer

func StartConfigDeliverServer(t *testing.T, ledger ConfigLedger) string

StartConfigDeliverServer starts an in-process AtomicBroadcast server emulating the given config ledger, and returns its "host:port" address. The server is stopped when the test ends.

Types

type ConfigLedger

type ConfigLedger struct {
	NewestNumber            uint64
	ConfigIndex             uint64
	ConfigSequence          uint64
	ConfigSignatureMetadata []byte
}

ConfigLedger describes the ledger a config-deliver stub emulates: its newest block number, the number of the config block that newest points at, and the config sequence that config block carries. ConfigSignatureMetadata, when set, is placed in the served config block's SIGNATURES metadata slot; it lets a test emulate assemblers that committed the same config block but carry different orderer-signature metadata, as real assemblers do.

Jump to

Keyboard shortcuts

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