/// Creates a new test environment with the given number of nodes.
Creates a new test environment with the given number of nodes.
Creates a new test environment with the given number of nodes .
pub fn new(num_of_nodes: usize) -> Self {
        let registry_data = Arc::new(ProtoRegistryDataProvider::new());
        let registry = Arc::new(FakeRegistryClient::new(Arc::clone(&registry_data) as Arc<_>));
        let registry_version = { RegistryVersion::new(thread_rng().gen_range(1, u32::MAX) as u64) };
        let mut env = Self {
            crypto_components: BTreeMap::new(),
            registry_data,
            registry,
            registry_version,
        };
        let node_ids = Self::n_random_node_ids(num_of_nodes);
        for node_id in node_ids {
            env.create_crypto_component_with_key_in_registry(node_id);
        }
        env.registry.update_to_latest_version();
        env
    }
pub fn new ( num_of_nodes : usize ) -> Self { let registry_data = Arc :: new ( ProtoRegistryDataProvider :: new ( ) ) ; let registry = Arc :: new ( FakeRegistryClient :: new ( Arc :: clone ( & registry_data ) as Arc < _ > ) ) ; let registry_version = { RegistryVersion :: new ( thread_rng ( ) . gen_range ( 1 , u32 :: MAX ) as u64 ) } ; let mut env = Self { crypto_components : BTreeMap :: new ( ) , registry_data , registry , registry_version , } ; let node_ids = Self :: n_random_node_ids ( num_of_nodes ) ; for node_id in node_ids { env . create_crypto_component_with_key_in_registry ( node_id ) ; } env . registry . update_to_latest_version ( ) ; env }
Creates a new test environment with the given number of nodes.
Creates a new test environment with the given number of nodes .
num_of_nodes
usize