referrerpolicy=no-referrer-when-downgrade

Crate polkadot_primitives_test_helpers

Source
Expand description

A set of primitive constructors, to aid in crafting meaningful testcase while reducing repetition.

Note that dummy_ prefixed values are meant to be fillers, that should not matter, and will contain randomness based data.

Re-exports§

pub use rand;

Structs§

AlwaysZeroRng
A special Rng that always returns zero for testing something that implied to be random but should not be random in the tests
TestCandidateBuilder
Builder for CandidateReceipt.

Functions§

dummy_candidate_commitments
Create candidate commitments with filler data.
dummy_candidate_descriptor
Create a candidate descriptor with filler data.
dummy_candidate_descriptor_bad_sig
Create a candidate descriptor with a bogus signature and filler data.
dummy_candidate_descriptor_v2
Create a v2 candidate descriptor with filler data.
dummy_candidate_receipt
Creates a candidate receipt with filler data.
dummy_candidate_receipt_bad_sig
Create a candidate receipt with a bogus signature and filler data. Optionally set the commitment hash with the commitments arg.
dummy_candidate_receipt_v2
Creates a v2 candidate receipt with filler data.
dummy_candidate_receipt_v2_bad_sig
Create a candidate receipt with a bogus signature and filler data. Optionally set the commitment hash with the commitments arg.
dummy_collator
Create a meaningless collator id.
dummy_collator_signature
Create a meaningless collator signature. It is important to not be 0, as we’d confuse v1 and v2 descriptors.
dummy_committed_candidate_receipt
Creates a committed candidate receipt with filler data.
dummy_committed_candidate_receipt_v2
Creates a v2 committed candidate receipt with filler data.
dummy_digest
Create meaningless dummy digest.
dummy_hash
Create meaningless dummy hash.
dummy_head_data
Create meaningless head data.
dummy_pvd
Create a meaningless persisted validation data.
dummy_signature
Creates a meaningless signature
dummy_validation_code
Create meaningless validation code.
dummy_validator
Create a meaningless validator id.
make_candidate
Create a meaningless candidate, returning its receipt and PVD.
make_candidate_v2
Create a meaningless v2 candidate, returning its receipt and PVD.
make_valid_candidate_descriptor
Create a new candidate descriptor, and apply a valid signature using the provided collator key.
make_valid_candidate_descriptor_v2
Create a v2 candidate descriptor.
resign_candidate_descriptor_with_collator
After manually modifying the candidate descriptor, resign with a defined collator key.
validator_pubkeys
Extracts validators’s public keys (ValidatorId) from Sr25519Keyring
zero_collator_signature
Create a zeroed collator signature.