mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 07:01:05 +00:00
Phragmen solution should submit for current era and be checked… (#5583)
* submit solution for current era * add test * address comment * fix tests
This commit is contained in:
@@ -506,6 +506,10 @@ pub type Session = pallet_session::Module<Test>;
|
||||
pub type Timestamp = pallet_timestamp::Module<Test>;
|
||||
pub type Staking = Module<Test>;
|
||||
|
||||
pub(crate) fn current_era() -> EraIndex {
|
||||
Staking::current_era().unwrap()
|
||||
}
|
||||
|
||||
fn post_conditions() {
|
||||
check_nominators();
|
||||
check_exposures();
|
||||
@@ -649,9 +653,13 @@ pub(crate) fn start_session(session_index: SessionIndex) {
|
||||
assert_eq!(Session::current_index(), session_index);
|
||||
}
|
||||
|
||||
// This start and activate the era given.
|
||||
// Because the mock use pallet-session which delays session by one, this will be one session after
|
||||
// the election happened, not the first session after the election has happened.
|
||||
pub(crate) fn start_era(era_index: EraIndex) {
|
||||
start_session((era_index * <SessionsPerEra as Get<u32>>::get()).into());
|
||||
assert_eq!(Staking::current_era().unwrap(), era_index);
|
||||
assert_eq!(Staking::active_era().unwrap().index, era_index);
|
||||
}
|
||||
|
||||
pub(crate) fn current_total_payout_for_duration(duration: u64) -> Balance {
|
||||
|
||||
Reference in New Issue
Block a user