fn internal_dealings_by_index_from_dealings(
    dealings: &BTreeMap<NodeId, IDkgMultiSignedDealing>,
    dealers: &IDkgDealers,
    op_type: &IDkgTranscriptOperation,
) -> Result<BTreeMap<NodeIndex, IDkgDealingInternal>, IDkgCreateTranscriptError> {
    fn deserialize_internal_dealing(
        raw: &[u8],
    ) -> Result<IDkgDealingInternal, IDkgCreateTranscriptError> {
        IDkgDealingInternal::deserialize(raw).map_err(|e| {
            IDkgCreateTranscriptError::SerializationError {
                internal_error: format!("{:?}", e),
            }
        })
    }

    dealings
        .iter()
        .map(|(id, d)| {
            let internal_dealing =
                deserialize_internal_dealing(&d.dealing.idkg_dealing.internal_dealing_raw)?;
            let index = id_to_index(*id, dealers, op_type)?;
            Ok((index, internal_dealing))
        })
        .collect()
}
/// Convert IDkgDealings to IDkgDealingInternals, and re-key the map to use
/// indices rather than ids
///
/// The indices are such that they allow the previous transcript(s) (if any)
/// to be properly recombined (i.e. the indices are for the previous sharing,
/// if this is a resharing or multiplication).
Convert IDkgDealings to IDkgDealingInternals, and re-key the map to use
indices rather than ids

The indices are such that they allow the previous transcript(s) (if any)
to be properly recombined .
Convert IDkgDealings to IDkgDealingInternals and re - key the map to use indices rather than ids The indices are such that they allow the previous transcript ( s ) ( if any ) to be properly recombined .
fn internal_dealings_by_index_from_dealings(
    dealings: &BTreeMap<NodeId, IDkgMultiSignedDealing>,
    dealers: &IDkgDealers,
    op_type: &IDkgTranscriptOperation,
) -> Result<BTreeMap<NodeIndex, IDkgDealingInternal>, IDkgCreateTranscriptError> {
    fn deserialize_internal_dealing(
        raw: &[u8],
    ) -> Result<IDkgDealingInternal, IDkgCreateTranscriptError> {
        IDkgDealingInternal::deserialize(raw).map_err(|e| {
            IDkgCreateTranscriptError::SerializationError {
                internal_error: format!("{:?}", e),
            }
        })
    }
    dealings
        .iter()
        .map(|(id, d)| {
            let internal_dealing =
                deserialize_internal_dealing(&d.dealing.idkg_dealing.internal_dealing_raw)?;
            let index = id_to_index(*id, dealers, op_type)?;
            Ok((index, internal_dealing))
        })
        .collect()
}
fn internal_dealings_by_index_from_dealings ( dealings : & BTreeMap < NodeId , IDkgMultiSignedDealing > , dealers : & IDkgDealers , op_type : & IDkgTranscriptOperation , ) -> Result < BTreeMap < NodeIndex , IDkgDealingInternal > , IDkgCreateTranscriptError > { fn deserialize_internal_dealing ( raw : & [ u8 ] , ) -> Result < IDkgDealingInternal , IDkgCreateTranscriptError > { IDkgDealingInternal :: deserialize ( raw ) . map_err ( | e | { IDkgCreateTranscriptError :: SerializationError { internal_error : format ! ( " " e ) , } } ) } dealings . iter ( ) . map ( | ( id , d ) | { let internal_dealing = deserialize_internal_dealing ( & d . dealing . idkg_dealing . internal_dealing_raw ) ? ; let index = id_to_index ( * id , dealers , op_type ) ? ; Ok ( ( index , internal_dealing ) ) } ) . collect ( ) }
Convert IDkgDealings to IDkgDealingInternals, and re-key the map to use
indices rather than ids
Convert IDkgDealings to IDkgDealingInternals and re - key the map to use indices rather than ids
dealings
&BTreeMap<NodeId, IDkgMultiSignedDealing>
dealers
&IDkgDealers
op_type
&IDkgTranscriptOperation
dealings
&BTreeMap<NodeId, IDkgMultiSignedDealing>
dealers
&IDkgDealers
op_type
&IDkgTranscriptOperation