add coordinator side rotation test

This commit is contained in:
akildemir
2024-02-26 15:16:44 +03:00
parent 5f2e15604c
commit 360cd023a0
10 changed files with 445 additions and 203 deletions

View File

@@ -14,7 +14,9 @@ use serai_client::{
mod common;
use common::validator_sets::{set_keys, allocate_stake, deallocate_stake};
const EPOCH_INTERVAL: u64 = 5;
// TODO: get rid of this is constant and retrive the epoch numbers from sthe node directly
// since epochs doesn't always change at the exact intervals.
const EPOCH_INTERVAL: u64 = 300;
serai_test!(
set_keys_test: (|serai: Serai| async move {

View File

@@ -315,7 +315,7 @@ pub type ReportLongevity = <Runtime as pallet_babe::Config>::EpochDuration;
impl babe::Config for Runtime {
#[cfg(feature = "fast-epoch")]
#[allow(clippy::identity_op)]
type EpochDuration = ConstU64<{ DAYS / (24 * 60 * 2) }>; // 30 seconds
type EpochDuration = ConstU64<{ DAYS / (24 * 2) }>; // 30 minutes
#[cfg(not(feature = "fast-epoch"))]
#[allow(clippy::identity_op)]

View File

@@ -652,7 +652,7 @@ pub mod pallet {
// If not Serai, check the prior session had its keys cleared, which happens once its
// retired
return (network == NetworkId::Serai) ||
(!Keys::<T>::contains_key(ValidatorSet {
(Keys::<T>::contains_key(ValidatorSet {
network,
session: Session(current_session.0 - 1),
}));