Skip to content

Commit

Permalink
fix: fixed tests configuration after upgrading dependecies
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandar Brayanov committed Nov 20, 2024
1 parent 7c4e8d3 commit bb9e9ae
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 17 deletions.
26 changes: 24 additions & 2 deletions runtime/dancebox/src/tests/common/xcm/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use {
AccountId, AssignmentId, AuthorityDiscoveryId, ValidatorId,
},
emulated_integration_tests_common::build_genesis_storage,
polkadot_service::chain_spec::get_authority_keys_from_seed_no_beefy,
sc_consensus_grandpa::AuthorityId as GrandpaId,
sp_consensus_babe::AuthorityId as BabeId,
sp_consensus_beefy::ecdsa_crypto::AuthorityId as BeefyId,
Expand Down Expand Up @@ -46,6 +45,29 @@ where
AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()
}

/// Helper function to generate stash, controller and session key from seed
pub fn get_authority_keys_from_seed_no_beefy(
seed: &str,
) -> (
AccountId,
AccountId,
BabeId,
GrandpaId,
ValidatorId,
AssignmentId,
AuthorityDiscoveryId,
) {
(
get_account_id_from_seed::<sr25519::Public>(&format!("{}//stash", seed)),
get_account_id_from_seed::<sr25519::Public>(seed),
get_from_seed::<BabeId>(seed),
get_from_seed::<GrandpaId>(seed),
get_from_seed::<ValidatorId>(seed),
get_from_seed::<AssignmentId>(seed),
get_from_seed::<AuthorityDiscoveryId>(seed),
)
}

pub mod accounts {
use super::*;
pub const ALICE: &str = "Alice";
Expand Down Expand Up @@ -174,7 +196,7 @@ pub mod westend {
x.0.clone(),
x.1.clone(),
STASH,
westend_runtime::StakerStatus::Validator,
polkadot_runtime_common::StakerStatus::Validator,
)
})
.collect(),
Expand Down
2 changes: 1 addition & 1 deletion runtime/dancebox/src/tests/common/xcm/core_buyer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use {
*,
},
},
polkadot_runtime_parachains::assigner_on_demand as parachains_assigner_on_demand,
polkadot_runtime_parachains::on_demand as parachains_assigner_on_demand,
staging_xcm::latest::{MaybeErrorCode, Response},
tp_traits::ParaId,
xcm_emulator::Chain,
Expand Down
4 changes: 1 addition & 3 deletions runtime/dancebox/src/tests/common/xcm/core_buyer_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ use {
nimbus_primitives::NimbusId,
pallet_xcm_core_buyer::RelayXcmWeightConfigInner,
parity_scale_codec::Encode,
polkadot_runtime_parachains::{
assigner_on_demand as parachains_assigner_on_demand, configuration,
},
polkadot_runtime_parachains::{configuration, on_demand as parachains_assigner_on_demand},
sp_core::Pair,
sp_runtime::{traits::ValidateUnsigned, AccountId32},
staging_xcm::v3::QueryId,
Expand Down
2 changes: 1 addition & 1 deletion runtime/dancebox/src/tests/common/xcm/force_core_buyer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use {
*,
},
},
polkadot_runtime_parachains::assigner_on_demand as parachains_assigner_on_demand,
polkadot_runtime_parachains::on_demand as parachains_assigner_on_demand,
staging_xcm::latest::{MaybeErrorCode, Response},
tp_traits::ParaId,
xcm_emulator::Chain,
Expand Down
4 changes: 1 addition & 3 deletions runtime/relay-encoder/src/rococo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ pub enum OnDemandAssignmentProviderCall {

#[cfg(test)]
mod tests {
use {
super::*, polkadot_runtime_parachains::assigner_on_demand as parachains_assigner_on_demand,
};
use {super::*, polkadot_runtime_parachains::on_demand as parachains_assigner_on_demand};

#[test]
fn encode_place_order_allow_death() {
Expand Down
4 changes: 1 addition & 3 deletions runtime/relay-encoder/src/westend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ pub enum OnDemandAssignmentProviderCall {

#[cfg(test)]
mod tests {
use {
super::*, polkadot_runtime_parachains::assigner_on_demand as parachains_assigner_on_demand,
};
use {super::*, polkadot_runtime_parachains::on_demand as parachains_assigner_on_demand};

#[test]
fn encode_place_order_allow_death() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ use {
Configuration, ContainerRegistrar, GetCoreAllocationConfigurationImpl, Paras, Registrar,
ServicesPayment, TanssiAuthorityMapping, TanssiInvulnerables,
},
cumulus_primitives_core::{relay_chain::HeadData, ParaId},
cumulus_primitives_core::{
relay_chain::{HeadData, SchedulerParams},
ParaId,
},
frame_support::{assert_noop, assert_ok, dispatch::RawOrigin},
parity_scale_codec::Encode,
primitives::vstaging::SchedulerParams,
runtime_common::paras_registrar,
sp_consensus_aura::AURA_ENGINE_ID,
sp_core::Get,
Expand Down
2 changes: 1 addition & 1 deletion solo-chains/runtime/dancelight/src/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ impl<T: runtime_parachains::paras_inherent::Config> ParasInherentTestBuilder<T>
}

use {
frame_support::StorageHasher, primitives::vstaging::SchedulerParams,
cumulus_primitives_core::relay_chain::SchedulerParams, frame_support::StorageHasher,
tp_traits::ParathreadParams,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use {
tests::common::*, ContainerRegistrar, OnDemandAssignmentProvider, Paras, Registrar, Session,
},
cumulus_primitives_core::relay_chain::{
vstaging::SchedulerParams, AsyncBackingParams, CoreIndex, HeadData,
AsyncBackingParams, CoreIndex, HeadData, SchedulerParams,
},
dancelight_runtime_constants::time::EpochDurationInBlocks,
frame_support::assert_ok,
Expand Down

0 comments on commit bb9e9ae

Please sign in to comment.