referrerpolicy=no-referrer-when-downgrade

Module testing_utils

Source
Expand description

Testing utils for staking. Provides some common functions to setup staking state, such as bonding validators, nominators, and generating different types of solutions.

Functions§

clear_validators_and_nominators
This function removes all validators and nominators from storage.
create_funded_user
Grab a funded user.
create_funded_user_with_balance
Grab a funded user with max Balance.
create_stash_and_dead_payee
Create a stash and controller pair, where payouts go to a dead payee account. This is used to test worst case payout scenarios.
create_stash_controller
Create a stash and controller pair.
create_stash_controller_with_balance
Create a stash and controller pair with fixed balance.
create_unique_stash_controller
Create a unique stash and controller pair.
create_validators
create max validators.
create_validators_with_nominators_for_era
This function generates validators and nominators who are randomly nominating edge_per_nominator random validators (until to_nominate if provided).
create_validators_with_seed
create max validators, with a seed to help unintentional prevent account collisions.
current_era
get the current era.
migrate_to_old_currency
set_active_era
Set active era to the given era index.