Crate bp_test_utils

Source
Expand description

Utilities for testing runtime code.

Macros§

generate_owned_bridge_module_tests
Adds methods for testing the set_owner() and set_operating_mode() for a pallet. Some values are hardcoded like:

Structs§

Account
A test account which can be used to sign messages.
JustificationGeneratorParams
Configuration parameters when generating test GRANDPA justifications.

Constants§

ALICE
Set of test accounts with friendly names: Alice.
BOB
Set of test accounts with friendly names: Bob.
CHARLIE
Set of test accounts with friendly names: Charlie.
DAVE
Set of test accounts with friendly names: Dave.
EVE
Set of test accounts with friendly names: Eve.
FERDIE
Set of test accounts with friendly names: Ferdie.
PARAS_PALLET_NAME
Name of the Paras pallet used across tests.
TEST_GRANDPA_ROUND
GRANDPA round number used across tests.
TEST_GRANDPA_SET_ID
GRANDPA validators set id used across tests.

Functions§

accounts
Get a list of “unique” accounts.
authority_list
Convenience function to get a list of Grandpa authorities.
header_id
Convenience function for generating a Header ID at a given block number.
make_default_justification
Make a valid GRANDPA justification with sensible defaults
make_justification_for_header
Generate justifications in a way where we are able to tune the number of pre-commits and vote ancestries which are included in the justification.
prepare_parachain_heads_proof
Make valid proof for parachain heads
signed_precommit
Create signed precommit with given target.
test_header
Get a header for testing.
test_header_with_root
Get a header for testing with given state_root.
test_keyring
Get the corresponding identities from the keyring for the “standard” authority set.
verification_context
Get a valid justification verification context for a GRANDPA round.
voter_set
Get a valid set of voters for a Grandpa round.