Skip to content

Commit

Permalink
give support for altair and centrifuge
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed Apr 18, 2024
1 parent d478366 commit edaf53b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 17 additions & 3 deletions runtime/integration-tests/src/generic/cases/block_rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use sp_runtime::traits::{Get, Zero};

use crate::{
generic::{
config::Runtime,
config::{Runtime, RuntimeKind},
env::Env,
envs::runtime_env::RuntimeEnv,
utils,
Expand All @@ -19,7 +19,7 @@ use crate::{
genesis::{self, Genesis},
},
},
utils::accounts::Keyring,
utils::accounts::{default_accounts, Keyring},
};

crate::test_for_runtimes!(all, block_rewards_api);
Expand Down Expand Up @@ -59,7 +59,10 @@ fn block_rewards_api<T: Runtime>() {
});
}

crate::test_for_runtimes!([development], collator_list_synchronized);
crate::test_for_runtimes!(
[development, altair, centrifuge],
collator_list_synchronized
);
fn collator_list_synchronized<T: Runtime>() {
RuntimeEnv::<T>::from_parachain_storage(
Genesis::default()
Expand All @@ -80,6 +83,17 @@ fn collator_list_synchronized<T: Runtime>() {
Keyring::Ferdie.id(),
];

// altair and centrifuge use collator_allowlist,
// so we need to add the accounts there for them.
if T::KIND == RuntimeKind::Altair || T::KIND == RuntimeKind::Centrifuge {
for account in default_accounts() {
assert_ok!(pallet_collator_allowlist::Pallet::<T>::add(
RawOrigin::Root.into(),
account.id()
));
}
}

// SESSION 0 -> 1;
apply_and_check_session::<T>(1, collators_1.clone(), vec![]);

Expand Down
2 changes: 2 additions & 0 deletions runtime/integration-tests/src/generic/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ use sp_runtime::{
};

/// Kind of runtime to check in runtime time
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum RuntimeKind {
Development,
Altair,
Expand Down Expand Up @@ -153,6 +154,7 @@ pub trait Runtime:
+ pallet_collective::Config<CouncilCollective, Proposal = Self::RuntimeCallExt>
+ pallet_democracy::Config<Currency = pallet_balances::Pallet<Self>>
+ pallet_collator_selection::Config<Currency = pallet_balances::Pallet<Self>>
+ pallet_collator_allowlist::Config<ValidatorId = AccountId>
+ pallet_session::Config<Keys = Self::SessionKeysExt, ValidatorId = AccountId>
+ pallet_evm_chain_id::Config
+ pallet_evm::Config
Expand Down

0 comments on commit edaf53b

Please sign in to comment.