pub fn deal_with_incorrect_receiver_ids_should_fail(&mut self, rng: &mut ChaCha20Rng) {
        let (_dealer_index, dealer_id) = self
            .config
            .dealers
            .iter()
            .choose(rng)
            .expect("Config has no dealers");

        let dealer_node = self
            .network
            .nodes_by_node_id
            .get_mut(&dealer_id)
            .expect("Could not find dealer in nodes");

        // Choose another set of indices, leaving at least one gap in `[0..=n-1]`.
        let incorrect_receivers: BTreeMap<NodeIndex, CspFsEncryptionPublicKey> =
            Self::noncontiguous_indices(&self.config.receiver_keys, rng);
        let incorrect_indices: Vec<NodeIndex> = incorrect_receivers.keys().cloned().collect();

        let dealing = dealer_node.create_dealing(
            self.config.algorithm_id,
            self.config.dkg_id,
            self.config
                .dealers
                .position(dealer_node.node_id)
                .expect("The node is not in the set of Dealers"),
            self.config.threshold.get(),
            self.config.epoch,
            incorrect_receivers,
            self.config
                .resharing_transcript
                .as_ref()
                .map(CspPublicCoefficients::from),
        );
        match dealing {
            Ok(_) => panic!("Dealing should fail with indices: {:?}", incorrect_indices),
            Err(CspDkgCreateReshareDealingError::MisnumberedReceiverError { .. }) => (),
            Err(error) => panic!("Incorrect error: {:?}", error),
        }
    }
/// Verifies that dealing with non-contiguous receiver IDs returns an error
///
/// # Side effects
/// None, other than consuming randomness.
Verifies that dealing with non-contiguous receiver IDs returns an error
Verifies that dealing with non - contiguous receiver IDs returns an error
pub fn deal_with_incorrect_receiver_ids_should_fail(&mut self, rng: &mut ChaCha20Rng) {
        let (_dealer_index, dealer_id) = self
            .config
            .dealers
            .iter()
            .choose(rng)
            .expect("Config has no dealers");
        let dealer_node = self
            .network
            .nodes_by_node_id
            .get_mut(&dealer_id)
            .expect("Could not find dealer in nodes");
        // Choose another set of indices, leaving at least one gap in `[0..=n-1]`.
        let incorrect_receivers: BTreeMap<NodeIndex, CspFsEncryptionPublicKey> =
            Self::noncontiguous_indices(&self.config.receiver_keys, rng);
        let incorrect_indices: Vec<NodeIndex> = incorrect_receivers.keys().cloned().collect();
        let dealing = dealer_node.create_dealing(
            self.config.algorithm_id,
            self.config.dkg_id,
            self.config
                .dealers
                .position(dealer_node.node_id)
                .expect("The node is not in the set of Dealers"),
            self.config.threshold.get(),
            self.config.epoch,
            incorrect_receivers,
            self.config
                .resharing_transcript
                .as_ref()
                .map(CspPublicCoefficients::from),
        );
        match dealing {
            Ok(_) => panic!("Dealing should fail with indices: {:?}", incorrect_indices),
            Err(CspDkgCreateReshareDealingError::MisnumberedReceiverError { .. }) => (),
            Err(error) => panic!("Incorrect error: {:?}", error),
        }
    }
pub fn deal_with_incorrect_receiver_ids_should_fail ( & mut self , rng : & mut ChaCha20Rng ) { let ( _dealer_index , dealer_id ) = self . config . dealers . iter ( ) . choose ( rng ) . expect ( " " ) ; let dealer_node = self . network . nodes_by_node_id . get_mut ( & dealer_id ) . expect ( " " ) ; // Choose another set of indices, leaving at least one gap in `[0..=n-1]`. let incorrect_receivers : BTreeMap < NodeIndex , CspFsEncryptionPublicKey > = Self :: noncontiguous_indices ( & self . config . receiver_keys , rng ) ; let incorrect_indices : Vec < NodeIndex > = incorrect_receivers . keys ( ) . cloned ( ) . collect ( ) ; let dealing = dealer_node . create_dealing ( self . config . algorithm_id , self . config . dkg_id , self . config . dealers . position ( dealer_node . node_id ) . expect ( " " ) , self . config . threshold . get ( ) , self . config . epoch , incorrect_receivers , self . config . resharing_transcript . as_ref ( ) . map ( CspPublicCoefficients :: from ) , ) ; match dealing { Ok ( _ ) => panic ! ( " " incorrect_indices ) , Err ( CspDkgCreateReshareDealingError :: MisnumberedReceiverError { .. } ) => ( ) , Err ( error ) => panic ! ( " " error ) , } }
Verifies that dealing with non-contiguous receiver IDs returns an error
Verifies that dealing with non - contiguous receiver IDs returns an error
&mut self
rng
&mut ChaCha20Rng
&mut self
rng
&mut ChaCha20Rng
side effects
None, other than consuming randomness.
None other than consuming randomness .