referrerpolicy=no-referrer-when-downgrade

Crate polkadot_node_subsystem_test_helpers

Source
Expand description

Utilities for testing subsystems.

Modules§

mock
Generally useful mock data providers for unit tests.

Macros§

arbitrary_order
Asserts that two patterns match, yet only one

Structs§

ForwardSubsystem
A forward subsystem that implements Subsystem.
MessageCounter
Message counter over subsystems.
SingleItemSink
The sink half of a single-item sink that does not resolve until the item has been read.
SingleItemStream
The stream half of a single-item sink.
TestSubsystemContext
A test subsystem context.
TestSubsystemContextHandle
A handle for interacting with the subsystem context.
TestSubsystemSender
A test subsystem sender.
Yield
Future that yields the execution once and resolves immediately after.

Functions§

derive_erasure_chunks_with_proofs_and_root
Helper for chunking available data.
make_buffered_subsystem_context
Make a test subsystem context with buffered overseer channel. Some tests (e.g. dispute-coordinator) create too many parallel operations and deadlock unless the channel is buffered. Usually buffer_size=1 is enough.
make_subsystem_context
Make a test subsystem context with buffer_size == 0. This is used by most of the tests.
sender_receiver
Construct a sender/receiver pair.
single_item_sink
Create a single-item Sink/Stream pair.
subsystem_test_harness
Test a subsystem, mocking the overseer