Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions bin/node/cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,7 @@ pub fn local_testnet_config() -> ChainSpec {
#[cfg(test)]
pub(crate) mod tests {
use super::*;
use crate::service::new_full;
use sc_service::Roles;
use crate::service::{new_full, new_light};
use sc_service_test;

fn local_testnet_genesis_instant_single() -> GenesisConfig {
Expand Down Expand Up @@ -398,12 +397,7 @@ pub(crate) mod tests {
sc_service_test::connectivity(
integration_test_config_with_two_authorities(),
|config| new_full(config),
|mut config| {
// light nodes are unsupported
config.roles = Roles::FULL;
new_full(config)
},
true,
|config| new_light(config),
);
}
}
22 changes: 5 additions & 17 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ mod tests {
use sp_timestamp;
use sp_finality_tracker;
use sp_keyring::AccountKeyring;
use sc_service::{AbstractService, Roles};
use crate::service::new_full;
use sc_service::AbstractService;
use crate::service::{new_full, new_light};
use sp_runtime::traits::IdentifyAccount;

type AccountPublic = <Signature as Verify>::Signer;
Expand Down Expand Up @@ -470,11 +470,7 @@ mod tests {
sc_service_test::sync(
sc_chain_spec::integration_test_config(),
|config| new_full(config),
|mut config| {
// light nodes are unsupported
config.roles = Roles::FULL;
new_full(config)
},
|mut config| new_light(config),
block_factory,
extrinsic_factory,
);
Expand Down Expand Up @@ -510,11 +506,7 @@ mod tests {
setup_handles = Some((block_import.clone(), babe_link.clone()));
}).map(move |(node, x)| (node, (x, setup_handles.unwrap())))
},
|mut config| {
// light nodes are unsupported
config.roles = Roles::FULL;
new_full(config)
},
|config| new_light(config),
|service, &mut (ref inherent_data_providers, (ref mut block_import, ref babe_link))| {
let mut inherent_data = inherent_data_providers
.create_inherent_data()
Expand Down Expand Up @@ -638,11 +630,7 @@ mod tests {
sc_service_test::consensus(
crate::chain_spec::tests::integration_test_config_with_two_authorities(),
|config| new_full(config),
|mut config| {
// light nodes are unsupported
config.roles = Roles::FULL;
new_full(config)
},
|config| new_light(config),
vec![
"//Alice".into(),
"//Bob".into(),
Expand Down
8 changes: 1 addition & 7 deletions client/service/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,6 @@ pub fn connectivity<G, E, Fb, F, Lb, L>(
spec: ChainSpec<G, E>,
full_builder: Fb,
light_builder: Lb,
light_node_interconnectivity: bool, // should normally be false, unless the light nodes
// aren't actually light.
) where
E: Clone,
Fb: Fn(Configuration<(), G, E>) -> Result<F, Error>,
Expand All @@ -312,11 +310,7 @@ pub fn connectivity<G, E, Fb, F, Lb, L>(
const NUM_LIGHT_NODES: usize = 5;

let expected_full_connections = NUM_FULL_NODES - 1 + NUM_LIGHT_NODES;
let expected_light_connections = if light_node_interconnectivity {
expected_full_connections
} else {
NUM_FULL_NODES
};
let expected_light_connections = NUM_FULL_NODES;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be NUM_LIGHT_NODES?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a number of connections at light nodes. Light nodes only connect to full nodes => NUM_FULL_NODES.


{
let temp = tempdir_with_prefix("substrate-connectivity-test");
Expand Down