/// Creates an initial DKG config for a subnet initially containing the
/// nodes `nodes_in_subnet`.
///
/// The DKG ID contained in the config uses `Height` 0 as instance ID
/// together with the given `subnet_id`. The receivers in the config are
/// the `nodes_in_subnet`.
///
/// # Panics
/// The function panics if `nodes_in_subnet` is empty.
Creates an initial DKG config for a subnet initially containing the
nodes `nodes_in_subnet`.

The DKG ID contained in the config uses `Height` 0 as instance ID
together with the given `subnet_id`. The receivers in the config are
the `nodes_in_subnet`.
Creates an initial DKG config for a subnet initially containing the nodes ` nodes_in_subnet ` . The DKG ID contained in the config uses ` Height ` 0 as instance ID together with the given ` subnet_id ` . The receivers in the config are the ` nodes_in_subnet ` .
pub fn new(nodes_in_subnet: &BTreeSet<NodeId>, subnet_id: SubnetId) -> Self {
        Self::ensure_subnet_not_empty(nodes_in_subnet);
        let threshold = get_threshold_for_committee_of_size(nodes_in_subnet.len());
        let dummy_dealers: Vec<NodeId> = (1u64..)
            .map(PrincipalId::new_node_test_id)
            .map(NodeId::from)
            .filter(|node_id| !nodes_in_subnet.contains(node_id))
            .take(threshold)
            .collect();
        let dkg_config = dkg::Config {
            dkg_id: IDkgId {
                instance_id: Height::from(0),
                subnet_id,
            },
            dealers: dummy_dealers,
            receivers: nodes_in_subnet.iter().cloned().collect(),
            threshold,
            resharing_transcript: None,
        };
        Self { dkg_config }
    }
pub fn new ( nodes_in_subnet : & BTreeSet < NodeId > , subnet_id : SubnetId ) -> Self { Self :: ensure_subnet_not_empty ( nodes_in_subnet ) ; let threshold = get_threshold_for_committee_of_size ( nodes_in_subnet . len ( ) ) ; let dummy_dealers : Vec < NodeId > = ( 1u64 .. ) . map ( PrincipalId :: new_node_test_id ) . map ( NodeId :: from ) . filter ( | node_id | ! nodes_in_subnet . contains ( node_id ) ) . take ( threshold ) . collect ( ) ; let dkg_config = dkg :: Config { dkg_id : IDkgId { instance_id : Height :: from ( 0 ) , subnet_id , } , dealers : dummy_dealers , receivers : nodes_in_subnet . iter ( ) . cloned ( ) . collect ( ) , threshold , resharing_transcript : None , } ; Self { dkg_config } }
Creates an initial DKG config for a subnet initially containing the
nodes `nodes_in_subnet`.
Creates an initial DKG config for a subnet initially containing the nodes ` nodes_in_subnet ` .
nodes_in_subnet
&BTreeSet<NodeId>
subnet_id
SubnetId
panics
The function panics if `nodes_in_subnet` is empty.
The function panics if ` nodes_in_subnet ` is empty .