Skip to content

Commit

Permalink
xcm-emulator tests: remove dependency on polkadot-service full-node (p…
Browse files Browse the repository at this point in the history
…aritytech#3323)

Don't bring the full polkadot node (with all its dependencies) in
`emulated-integration-tests-common` crate and deps.
  • Loading branch information
acatangiu authored Feb 15, 2024
1 parent 5cfc05d commit f604860
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ use polkadot_primitives::{AssignmentId, ValidatorId};

// Cumulus
use emulated_integration_tests_common::{
accounts, build_genesis_storage, get_account_id_from_seed, get_from_seed, get_host_config,
validators,
accounts, build_genesis_storage, get_account_id_from_seed, get_host_config, validators,
};
use parachains_common::Balance;
use rococo_runtime_constants::currency::UNITS as ROC;
Expand Down Expand Up @@ -71,7 +70,7 @@ pub fn genesis() -> Storage {
x.4.clone(),
x.5.clone(),
x.6.clone(),
get_from_seed::<BeefyId>("Alice"),
x.7.clone(),
),
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use polkadot_primitives::{AssignmentId, ValidatorId};

// Cumulus
use emulated_integration_tests_common::{
accounts, build_genesis_storage, get_from_seed, get_host_config, validators,
accounts, build_genesis_storage, get_host_config, validators,
};
use parachains_common::Balance;
use westend_runtime_constants::currency::UNITS as WND;
Expand Down Expand Up @@ -72,7 +72,7 @@ pub fn genesis() -> Storage {
x.4.clone(),
x.5.clone(),
x.6.clone(),
get_from_seed::<BeefyId>("Alice"),
x.7.clone(),
),
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ codec = { package = "parity-scale-codec", version = "3.4.0", default-features =
paste = "1.0.14"

# Substrate
beefy-primitives = { package = "sp-consensus-beefy", path = "../../../../../substrate/primitives/consensus/beefy" }
grandpa = { package = "sc-consensus-grandpa", path = "../../../../../substrate/client/consensus/grandpa" }
sp-authority-discovery = { path = "../../../../../substrate/primitives/authority-discovery" }
sp-runtime = { path = "../../../../../substrate/primitives/runtime" }
Expand All @@ -25,7 +26,6 @@ pallet-balances = { path = "../../../../../substrate/frame/balances" }
pallet-message-queue = { path = "../../../../../substrate/frame/message-queue" }

# Polkadot
polkadot-service = { path = "../../../../../polkadot/node/service", default-features = false, features = ["full-node"] }
polkadot-primitives = { path = "../../../../../polkadot/primitives" }
polkadot-runtime-parachains = { path = "../../../../../polkadot/runtime/parachains" }
xcm = { package = "staging-xcm", path = "../../../../../polkadot/xcm" }
Expand Down
15 changes: 13 additions & 2 deletions cumulus/parachains/integration-tests/emulated/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub mod xcm_helpers;
pub use xcm_emulator;

// Substrate
use beefy_primitives::ecdsa_crypto::AuthorityId as BeefyId;
use grandpa::AuthorityId as GrandpaId;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
Expand All @@ -36,7 +37,6 @@ use polkadot_runtime_parachains::configuration::HostConfiguration;
// Cumulus
use parachains_common::{AccountId, AuraId};
use polkadot_primitives::{AssignmentId, ValidatorId};
use polkadot_service::chain_spec::get_authority_keys_from_seed_no_beefy;

pub const XCM_V2: u32 = 2;
pub const XCM_V3: u32 = 3;
Expand Down Expand Up @@ -152,7 +152,18 @@ pub mod validators {
ValidatorId,
AssignmentId,
AuthorityDiscoveryId,
BeefyId,
)> {
vec![get_authority_keys_from_seed_no_beefy("Alice")]
let seed = "Alice";
vec![(
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),
get_from_seed::<BeefyId>(seed),
)]
}
}

0 comments on commit f604860

Please sign in to comment.