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 ¶
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 ¶
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.