Staking e2e test - Add case when ledger active balance falls below ED (#14247)

* Staking e2e test - case when ledger active balance falls below ED

* Update frame/election-provider-multi-phase/test-staking-e2e/src/lib.rs

Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>

* Simplifies test assertions; tests events

---------

Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Gonçalo Pestana
2023-07-18 22:01:36 +02:00
committed by GitHub
parent b6b1952fc6
commit bc84e1b838
2 changed files with 77 additions and 2 deletions
@@ -19,7 +19,8 @@
use _feps::ExtendedBalance;
use frame_support::{
dispatch::UnfilteredDispatchable, parameter_types, traits, traits::Hooks, weights::constants,
assert_ok, dispatch::UnfilteredDispatchable, parameter_types, traits, traits::Hooks,
weights::constants,
};
use frame_system::EnsureRoot;
use sp_core::{ConstU32, Get};
@@ -705,6 +706,12 @@ pub(crate) fn start_next_active_era_delayed_solution(
start_active_era(active_era() + 1, pool, true)
}
pub(crate) fn advance_eras(n: usize, pool: Arc<RwLock<PoolState>>) {
for _ in 0..n {
assert_ok!(start_next_active_era(pool.clone()));
}
}
/// Progress until the given era.
pub(crate) fn start_active_era(
era_index: EraIndex,